aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-08-26 17:40:59 -0700
committerAnton Tananaev <anton@traccar.org>2023-08-26 17:40:59 -0700
commit778d626e5ca58f62b75ef070c5c347afa89a6de4 (patch)
treeafc2821805ddd65bfb24b65cbd60cc4239eee3c9 /modern/src/settings
parente5d05451febf482f1192b2a4ba49b9275e236722 (diff)
downloadtrackermap-web-778d626e5ca58f62b75ef070c5c347afa89a6de4.tar.gz
trackermap-web-778d626e5ca58f62b75ef070c5c347afa89a6de4.tar.bz2
trackermap-web-778d626e5ca58f62b75ef070c5c347afa89a6de4.zip
Dark mode support (fix #1129)
Diffstat (limited to 'modern/src/settings')
-rw-r--r--modern/src/settings/PreferencesPage.jsx84
1 files changed, 44 insertions, 40 deletions
diff --git a/modern/src/settings/PreferencesPage.jsx b/modern/src/settings/PreferencesPage.jsx
index b83e7095..15fd762a 100644
--- a/modern/src/settings/PreferencesPage.jsx
+++ b/modern/src/settings/PreferencesPage.jsx
@@ -114,48 +114,9 @@ const PreferencesPage = () => {
return (
<PageLayout menu={<SettingsMenu />} breadcrumbs={['settingsTitle', 'sharedPreferences']}>
<Container maxWidth="xs" className={classes.container}>
- <Accordion defaultExpanded>
- <AccordionSummary expandIcon={<ExpandMoreIcon />}>
- <Typography variant="subtitle1">
- {t('userToken')}
- </Typography>
- </AccordionSummary>
- <AccordionDetails className={classes.details}>
- <TextField
- label={t('userExpirationTime')}
- type="date"
- value={tokenExpiration}
- onChange={(e) => {
- setTokenExpiration(e.target.value);
- setToken(null);
- }}
- />
- <FormControl>
- <OutlinedInput
- multiline
- rows={6}
- readOnly
- type="text"
- value={token || ''}
- endAdornment={(
- <InputAdornment position="end">
- <div className={classes.tokenActions}>
- <IconButton size="small" edge="end" onClick={generateToken} disabled={!!token}>
- <CachedIcon fontSize="small" />
- </IconButton>
- <IconButton size="small" edge="end" onClick={() => navigator.clipboard.writeText(token)} disabled={!token}>
- <ContentCopyIcon fontSize="small" />
- </IconButton>
- </div>
- </InputAdornment>
- )}
- />
- </FormControl>
- </AccordionDetails>
- </Accordion>
{!readonly && (
<>
- <Accordion>
+ <Accordion defaultExpanded>
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
<Typography variant="subtitle1">
{t('mapTitle')}
@@ -346,6 +307,49 @@ const PreferencesPage = () => {
/>
</AccordionDetails>
</Accordion>
+ </>
+ )}
+ <Accordion>
+ <AccordionSummary expandIcon={<ExpandMoreIcon />}>
+ <Typography variant="subtitle1">
+ {t('userToken')}
+ </Typography>
+ </AccordionSummary>
+ <AccordionDetails className={classes.details}>
+ <TextField
+ label={t('userExpirationTime')}
+ type="date"
+ value={tokenExpiration}
+ onChange={(e) => {
+ setTokenExpiration(e.target.value);
+ setToken(null);
+ }}
+ />
+ <FormControl>
+ <OutlinedInput
+ multiline
+ rows={6}
+ readOnly
+ type="text"
+ value={token || ''}
+ endAdornment={(
+ <InputAdornment position="end">
+ <div className={classes.tokenActions}>
+ <IconButton size="small" edge="end" onClick={generateToken} disabled={!!token}>
+ <CachedIcon fontSize="small" />
+ </IconButton>
+ <IconButton size="small" edge="end" onClick={() => navigator.clipboard.writeText(token)} disabled={!token}>
+ <ContentCopyIcon fontSize="small" />
+ </IconButton>
+ </div>
+ </InputAdornment>
+ )}
+ />
+ </FormControl>
+ </AccordionDetails>
+ </Accordion>
+ {!readonly && (
+ <>
<Accordion>
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
<Typography variant="subtitle1">