-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from Som-Energia/FIX_maintenance_screen_language
🐛 set language at i18n if maintenance screen
- Loading branch information
Showing
2 changed files
with
79 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,54 @@ | ||
import React from 'react' | ||
import React, { useEffect } from 'react' | ||
import Container from '@mui/material/Container' | ||
|
||
import { useTranslation } from 'react-i18next' | ||
|
||
import manteniment from '../images/tasques-manteniment-web.svg' | ||
|
||
const Maintenance = () => { | ||
const { t } = useTranslation() | ||
const { t, i18n } = useTranslation() | ||
|
||
return <Container sx={{ flexGrow: 1, padding: 12 }}> | ||
<div style={{ | ||
'display': 'block', | ||
textAlign: 'center', | ||
alignItems: 'center', | ||
}}> | ||
<img src={manteniment} alt="Estem en mode manteniment" /> | ||
</div> | ||
<div style={{ | ||
marginTop: '15px', | ||
color: '#4d4d4d', | ||
fontFamily: 'Roboto, sans-serif', | ||
fontSize: '4em', | ||
fontWeight: 'bold', | ||
textAlign: 'center', | ||
}}>{t("MAINTENANCE_TEXT1")}</div> | ||
<div style={{ | ||
marginTop: '15px', | ||
color: '#96B633', | ||
fontFamily: 'Roboto, sans-serif', | ||
fontSize: '5em', | ||
fontWeight: 'bold', | ||
textAlign: 'center', | ||
}}>{t("MAINTENANCE_TEXT2")}</div> | ||
</Container> | ||
useEffect(() => { | ||
const language = window.location.pathname.split('/')[1] | ||
if (['ca', 'es', 'eu', 'gl'].includes(language)) { | ||
i18n.changeLanguage(language) | ||
} | ||
}, []) | ||
|
||
return ( | ||
<Container sx={{ flexGrow: 1, padding: 12 }}> | ||
<div | ||
style={{ | ||
display: 'block', | ||
textAlign: 'center', | ||
alignItems: 'center' | ||
}}> | ||
<img src={manteniment} alt="Estem en mode manteniment" /> | ||
</div> | ||
<div | ||
style={{ | ||
marginTop: '15px', | ||
color: '#4d4d4d', | ||
fontFamily: 'Roboto, sans-serif', | ||
fontSize: '4em', | ||
fontWeight: 'bold', | ||
textAlign: 'center' | ||
}}> | ||
{t('MAINTENANCE_TEXT1')} | ||
</div> | ||
<div | ||
style={{ | ||
marginTop: '15px', | ||
color: '#96B633', | ||
fontFamily: 'Roboto, sans-serif', | ||
fontSize: '5em', | ||
fontWeight: 'bold', | ||
textAlign: 'center' | ||
}}> | ||
{t('MAINTENANCE_TEXT2')} | ||
</div> | ||
</Container> | ||
) | ||
} | ||
|
||
export default Maintenance |