welcome personal

Seto committed Nov 28, 2025 at 23:39 UTC 1dd597fc1c17c901fe984f1fad14c3384d43f16d
3 files changed +18 -5
src/pages/Home.tsx
+3 -1
@@ -1,9 +1,11 @@
1 import { Link } from "react-router-dom";
2 import haptics from "./../utils/haptics";
3 import { useLang } from "../context/LanguageContext";
4 +import { useAccount } from "../context/AccountContext";
5
6 export default function Home() {
7 const { t } = useLang();
8 + const { user, onLoggedIn, onLoggedOut } = useAccount();
9 return (
10 <section className="flex flex-col items-center justify-center min-h-[30vh]">
11 <svg
@@ -26,7 +28,7 @@ export default function Home() {
28 </text>
29 </svg>
30 <h1 className="text-3xl md:text-4xl font-bold text-center mb-4 text-cut-blue">
29 - {t.welcome}
31 + {user ? t.welcomePersonal(user.name) : t.welcome}
32 </h1>
33 <p className="text-lg text-center mb-8 text-slate-600">{t.homeDesc}</p>
34 <Link
src/pages/Profile.tsx
+3
@@ -125,6 +125,9 @@ export default function Profile() {
125 {/* LOGGED OUT */}
126 {!user && (
127 <div className=" rounded-lg shadow-md p-6">
128 + <div className="flex items-center space-x-4 mb-4">
129 + {t.oAuthLoginExplanation}
130 + </div>
131 <button
132 onClick={async () => {
133 await haptics.buttonPress();
src/utils/i18n.ts
+12 -4
@@ -6,6 +6,7 @@ export interface Translation {
6 bookings: string;
7 profile: string;
8 welcome: string;
9 + welcomePersonal: (name: string) => string;
10 homeDesc: string;
11 bookNow: string;
12 viewServices: string;
@@ -37,6 +38,7 @@ export interface Translation {
38 bookingSuccess: string;
39 bookingError: string;
40 textToBook: string;
41 + oAuthLoginExplanation: string;
42 googleOAuthLogin: string;
43 appleOAuthLogin: string;
44 logout: string;
@@ -53,6 +55,7 @@ export const translations: Record<SupportedLanguage, Translation> = {
55 bookings: "رزرو‌ها",
56 profile: "پروفایل",
57 welcome: "به هاگرستن استریت کات خوش آمدید!",
58 + welcomePersonal: (name) => `به رومی خوش آمد, ${name}!`,
59 homeDesc: "بهترین آرایشگاه در جنوب استکهلم",
60 bookNow: "رزرو نوبت",
61 viewServices: "مشاهده خدمات",
@@ -84,8 +87,9 @@ export const translations: Record<SupportedLanguage, Translation> = {
87 bookingSuccess: "رزرو با موفقیت انجام شد!",
88 bookingError: "خطا در رزرو. لطفاً دوباره تلاش کنید.",
89 textToBook: "برای رزرو پیامک بفرستید",
87 - googleOAuthLogin: "Login with Google",
88 - appleOAuthLogin: "Sign in with Apple",
90 + oAuthLoginExplanation: "برای مشاهده رزرو خود وارد شوید.",
91 + googleOAuthLogin: "ورود با گوگل",
92 + appleOAuthLogin: "با اپل وارد شوید",
93 logout: "خروج از سیستم",
94 },
95 en: {
@@ -96,6 +100,7 @@ export const translations: Record<SupportedLanguage, Translation> = {
100 bookings: "Bookings",
101 profile: "Profile",
102 welcome: "Welcome to Hägersten StreetCut!",
103 + welcomePersonal: (name) => `Welcome to Hägersten StreetCut, ${name}!`,
104 homeDesc: "The best barber shop in South Stockholm",
105 bookNow: "Book Now",
106 viewServices: "View Services",
@@ -127,6 +132,7 @@ export const translations: Record<SupportedLanguage, Translation> = {
132 bookingSuccess: "Booking successful!",
133 bookingError: "Booking error. Please try again.",
134 textToBook: "Text to book",
135 + oAuthLoginExplanation: "Login to see your booking.",
136 googleOAuthLogin: "Login with Google",
137 appleOAuthLogin: "Sign in with Apple",
138 logout: "Log out",
@@ -139,6 +145,7 @@ export const translations: Record<SupportedLanguage, Translation> = {
145 bookings: "Bokningar",
146 profile: "Profil",
147 welcome: "Välkommen till Hägersten StreetCut!",
148 + welcomePersonal: (name) => `Välkommen till Hägersten StreetCut, ${name}!`,
149 homeDesc: "Den bästa frisören i södra Stockholm",
150 bookNow: "Boka nu",
151 viewServices: "Visa tjänster",
@@ -170,8 +177,9 @@ export const translations: Record<SupportedLanguage, Translation> = {
177 bookingSuccess: "Bokning lyckades!",
178 bookingError: "Bokningsfel. Försök igen.",
179 textToBook: "SMS för att boka",
173 - googleOAuthLogin: "Loga in med Google",
174 - appleOAuthLogin: "Loga in med Apple",
180 + oAuthLoginExplanation: "Logga in för att se din bokning.",
181 + googleOAuthLogin: "Logga in på Google",
182 + appleOAuthLogin: "Logga in på Apple",
183 logout: "Loga ut",
184 },
185 };