diff options
Diffstat (limited to 'modern/src/settings/PreferencesPage.js')
-rw-r--r-- | modern/src/settings/PreferencesPage.js | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/modern/src/settings/PreferencesPage.js b/modern/src/settings/PreferencesPage.js index 39b76074..d9d0c87e 100644 --- a/modern/src/settings/PreferencesPage.js +++ b/modern/src/settings/PreferencesPage.js @@ -1,9 +1,11 @@ import React from 'react'; import { - Accordion, AccordionSummary, AccordionDetails, makeStyles, Typography, Container, FormControl, InputLabel, Select, MenuItem, + Accordion, AccordionSummary, AccordionDetails, makeStyles, Typography, Container, FormControl, InputLabel, Select, MenuItem, Checkbox, FormControlLabel, } from '@material-ui/core'; +import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { useLocalization, useTranslation } from '../LocalizationProvider'; import OptionsLayout from './OptionsLayout'; +import usePersistedState from '../common/usePersistedState'; const useStyles = makeStyles((theme) => ({ container: { @@ -21,11 +23,14 @@ const PreferencesPage = () => { const { languages, language, setLanguage } = useLocalization(); const languageList = Object.entries(languages).map((values) => ({ code: values[0], name: values[1].name })); + const [mapLiveRoutes, setMapLiveRoutes] = usePersistedState('mapLiveRoutes', false); + const [mapFollow, setMapFollow] = usePersistedState('mapFollow', false); + return ( <OptionsLayout> <Container maxWidth="xs" className={classes.container}> <Accordion defaultExpanded> - <AccordionSummary> + <AccordionSummary expandIcon={<ExpandMoreIcon />}> <Typography variant="subtitle1"> {t('sharedPreferences')} </Typography> @@ -39,6 +44,23 @@ const PreferencesPage = () => { </FormControl> </AccordionDetails> </Accordion> + <Accordion> + <AccordionSummary expandIcon={<ExpandMoreIcon />}> + <Typography variant="subtitle1"> + {t('mapTitle')} + </Typography> + </AccordionSummary> + <AccordionDetails className={classes.details}> + <FormControlLabel + control={<Checkbox checked={mapLiveRoutes} onChange={(event) => setMapLiveRoutes(event.target.checked)} />} + label={t('mapLiveRoutes')} + /> + <FormControlLabel + control={<Checkbox checked={mapFollow} onChange={(event) => setMapFollow(event.target.checked)} />} + label={t('deviceFollow')} + /> + </AccordionDetails> + </Accordion> </Container> </OptionsLayout> ); |