diff options
Diffstat (limited to 'modern/src/settings/components')
-rw-r--r-- | modern/src/settings/components/EditAttributesAccordion.jsx | 16 | ||||
-rw-r--r-- | modern/src/settings/components/EditItemView.jsx | 23 | ||||
-rw-r--r-- | modern/src/settings/components/SettingsMenu.jsx | 21 |
3 files changed, 19 insertions, 41 deletions
diff --git a/modern/src/settings/components/EditAttributesAccordion.jsx b/modern/src/settings/components/EditAttributesAccordion.jsx index 214ddb0e..4d4ae254 100644 --- a/modern/src/settings/components/EditAttributesAccordion.jsx +++ b/modern/src/settings/components/EditAttributesAccordion.jsx @@ -15,7 +15,6 @@ import { Typography, AccordionDetails, } from '@mui/material'; -import makeStyles from '@mui/styles/makeStyles'; import CloseIcon from '@mui/icons-material/Close'; import AddIcon from '@mui/icons-material/Add'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; @@ -26,21 +25,10 @@ import { distanceFromMeters, distanceToMeters, distanceUnitString, speedFromKnots, speedToKnots, speedUnitString, volumeFromLiters, volumeToLiters, volumeUnitString, } from '../../common/util/converter'; import useFeatures from '../../common/util/useFeatures'; - -const useStyles = makeStyles((theme) => ({ - removeButton: { - marginRight: theme.spacing(1.5), - }, - details: { - display: 'flex', - flexDirection: 'column', - gap: theme.spacing(2), - paddingBottom: theme.spacing(3), - }, -})); +import useSettingsStyles from '../common/useSettingsStyles'; const EditAttributesAccordion = ({ attribute, attributes, setAttributes, definitions, focusAttribute }) => { - const classes = useStyles(); + const classes = useSettingsStyles(); const t = useTranslation(); const features = useFeatures(); diff --git a/modern/src/settings/components/EditItemView.jsx b/modern/src/settings/components/EditItemView.jsx index d45855dd..61bc4161 100644 --- a/modern/src/settings/components/EditItemView.jsx +++ b/modern/src/settings/components/EditItemView.jsx @@ -1,37 +1,18 @@ import React from 'react'; import { useNavigate, useParams } from 'react-router-dom'; -import makeStyles from '@mui/styles/makeStyles'; import { Container, Button, Accordion, AccordionDetails, AccordionSummary, Skeleton, Typography, TextField, } from '@mui/material'; import { useCatch, useEffectAsync } from '../../reactHelper'; import { useTranslation } from '../../common/components/LocalizationProvider'; import PageLayout from '../../common/components/PageLayout'; - -const useStyles = makeStyles((theme) => ({ - container: { - marginTop: theme.spacing(2), - }, - buttons: { - marginTop: theme.spacing(2), - marginBottom: theme.spacing(2), - display: 'flex', - justifyContent: 'space-evenly', - '& > *': { - flexBasis: '33%', - }, - }, - details: { - display: 'flex', - flexDirection: 'column', - }, -})); +import useSettingsStyles from '../common/useSettingsStyles'; const EditItemView = ({ children, endpoint, item, setItem, defaultItem, validate, onItemSaved, menu, breadcrumbs, }) => { const navigate = useNavigate(); - const classes = useStyles(); + const classes = useSettingsStyles(); const t = useTranslation(); const { id } = useParams(); diff --git a/modern/src/settings/components/SettingsMenu.jsx b/modern/src/settings/components/SettingsMenu.jsx index 0f3ebbe5..6d8c0fd7 100644 --- a/modern/src/settings/components/SettingsMenu.jsx +++ b/modern/src/settings/components/SettingsMenu.jsx @@ -14,6 +14,7 @@ import TodayIcon from '@mui/icons-material/Today'; import PublishIcon from '@mui/icons-material/Publish'; import SmartphoneIcon from '@mui/icons-material/Smartphone'; import HelpIcon from '@mui/icons-material/Help'; +import CampaignIcon from '@mui/icons-material/Campaign'; import { Link, useLocation } from 'react-router-dom'; import { useSelector } from 'react-redux'; import { useTranslation } from '../../common/components/LocalizationProvider'; @@ -139,12 +140,20 @@ const SettingsMenu = () => { <Divider /> <List> {admin && ( - <MenuItem - title={t('settingsServer')} - link="/settings/server" - icon={<StorageIcon />} - selected={location.pathname === '/settings/server'} - /> + <> + <MenuItem + title={t('serverAnnouncement')} + link="/settings/announcement" + icon={<CampaignIcon />} + selected={location.pathname === '/settings/announcement'} + /> + <MenuItem + title={t('settingsServer')} + link="/settings/server" + icon={<StorageIcon />} + selected={location.pathname === '/settings/server'} + /> + </> )} <MenuItem title={t('settingsUsers')} |