Sample Language Implementation for namePage.jsx
This commit is contained in:
parent
c105f98d46
commit
98b04373b6
1 changed files with 11 additions and 2 deletions
|
@ -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 (
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
|
@ -20,7 +29,7 @@ function NamePage() {
|
|||
height: '100vh',
|
||||
flexDirection: 'column',
|
||||
}}>
|
||||
<label className='title'>What should we call you?</label>
|
||||
<label className='title'>{text.title}</label>
|
||||
|
||||
<div style={{
|
||||
height: '8vh'
|
||||
|
@ -35,7 +44,7 @@ function NamePage() {
|
|||
name==''?
|
||||
<></>
|
||||
:
|
||||
<BlackButton text="Continue" to='/introduction'/>
|
||||
<BlackButton text={text.continue} to='/introduction'/>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue