Part of #145. Fourteen files whose user-facing strings are generic enough to belong in `common` — loading and empty states, the confirmation modal, the shared input modals (text/date/user/attachment viewer), the mobile nav bar, the autocomplete input, the error screen and the file-upload error paths. Extends the namespace that already exists, so `src/i18n/config.js` is untouched and this cannot collide with any other extraction PR over the `ns:` array. 28 keys added to `public/locales/en/common.json`. English only — no translations, no behaviour change. Every t() value is checked against this branch's base: the string must appear character-for-character in the code it replaces (36 call sites). One value is matched loosely and worth naming: `errorScreen.hideDetails`. The base renders `{showDetails ? 'Hide' : 'Show'} error details`, so neither full phrase exists contiguously in the source — only one branch of the ternary can. Both keys hold exactly what each branch renders. The sentence is kept whole rather than split around the ternary, because a split sentence cannot be reordered by a translator.
49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
import { Box, Button, Container, Typography } from '@mui/joy'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { useEffect } from 'react'
|
|
import { useNavigate } from 'react-router-dom'
|
|
|
|
import { useState } from 'react'
|
|
import Logo from '../Logo'
|
|
const Home = () => {
|
|
const { t } = useTranslation('common')
|
|
const Navigate = useNavigate()
|
|
const getCurrentUser = () => {
|
|
return JSON.parse(localStorage.getItem('user'))
|
|
}
|
|
const [users, setUsers] = useState([])
|
|
const [currentUser, setCurrentUser] = useState(getCurrentUser())
|
|
|
|
useEffect(() => {}, [])
|
|
|
|
return (
|
|
<Container className='flex h-full items-center justify-center'>
|
|
<Box className='flex flex-col items-center justify-center'>
|
|
<Logo />
|
|
<Typography level='h1'>
|
|
Done
|
|
<span
|
|
style={{
|
|
color: '#06b6d4',
|
|
}}
|
|
>
|
|
tick
|
|
</span>
|
|
</Typography>
|
|
</Box>
|
|
<Box className='flex flex-col items-center justify-center' mt={10}>
|
|
<Button
|
|
sx={{ mt: 1 }}
|
|
onClick={() => {
|
|
Navigate('/chores')
|
|
}}
|
|
>
|
|
{t('getStarted')}
|
|
</Button>
|
|
</Box>
|
|
</Container>
|
|
)
|
|
}
|
|
|
|
export default Home
|