From 98b04373b64c803bc3e9d8f7a7b39dfc2351fef7 Mon Sep 17 00:00:00 2001 From: fufu-girl-meow Date: Tue, 24 Jun 2025 01:03:08 +0700 Subject: [PATCH] Sample Language Implementation for namePage.jsx --- src/pages/namePage.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/pages/namePage.jsx b/src/pages/namePage.jsx index 9f53238..c364a9d 100644 --- a/src/pages/namePage.jsx +++ b/src/pages/namePage.jsx @@ -8,10 +8,19 @@ function NamePage() { return sessionStorage.getItem("name") || ''; }); + const [lang] = useState(() => { + return sessionStorage.getItem("lang") || 'English'; + }); + useEffect(() => { sessionStorage.setItem("name", name); }, [name]); + const text = { + title: lang === 'Thai' ? 'อยากให้เรียกคุณว่าอะไร?' : 'What should we call you?', + continue: lang === 'Thai' ? 'ดำเนินการต่อ' : 'Continue' + } + return (
- +
: - + }
)