mirror of
https://github.com/traccar/traccar-web.git
synced 2025-01-09 04:37:33 +08:00
Use class instead of sx
This commit is contained in:
parent
547dafb6af
commit
f4cef90cf6
@ -14,17 +14,27 @@ import RouteIcon from '@mui/icons-material/Route';
|
|||||||
import EventRepeatIcon from '@mui/icons-material/EventRepeat';
|
import EventRepeatIcon from '@mui/icons-material/EventRepeat';
|
||||||
import NotesIcon from '@mui/icons-material/Notes';
|
import NotesIcon from '@mui/icons-material/Notes';
|
||||||
import { Link, useLocation } from 'react-router-dom';
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
|
import makeStyles from '@mui/styles/makeStyles';
|
||||||
import { useTranslation } from '../../common/components/LocalizationProvider';
|
import { useTranslation } from '../../common/components/LocalizationProvider';
|
||||||
import { useAdministrator, useRestriction } from '../../common/util/permissions';
|
import { useAdministrator, useRestriction } from '../../common/util/permissions';
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
menuItemText: {
|
||||||
|
whiteSpace: 'nowrap',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const MenuItem = ({
|
const MenuItem = ({
|
||||||
title, link, icon, selected,
|
title, link, icon, selected,
|
||||||
}) => (
|
}) => {
|
||||||
|
const classes = useStyles();
|
||||||
|
return (
|
||||||
<ListItemButton key={link} component={Link} to={link} selected={selected}>
|
<ListItemButton key={link} component={Link} to={link} selected={selected}>
|
||||||
<ListItemIcon>{icon}</ListItemIcon>
|
<ListItemIcon>{icon}</ListItemIcon>
|
||||||
<ListItemText primary={title} sx={{ whiteSpace: 'nowrap' }} />
|
<ListItemText primary={title} className={classes.menuItemText} />
|
||||||
</ListItemButton>
|
</ListItemButton>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const ReportsMenu = () => {
|
const ReportsMenu = () => {
|
||||||
const t = useTranslation();
|
const t = useTranslation();
|
||||||
|
@ -17,20 +17,30 @@ import HelpIcon from '@mui/icons-material/Help';
|
|||||||
import CampaignIcon from '@mui/icons-material/Campaign';
|
import CampaignIcon from '@mui/icons-material/Campaign';
|
||||||
import { Link, useLocation } from 'react-router-dom';
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
|
import makeStyles from '@mui/styles/makeStyles';
|
||||||
import { useTranslation } from '../../common/components/LocalizationProvider';
|
import { useTranslation } from '../../common/components/LocalizationProvider';
|
||||||
import {
|
import {
|
||||||
useAdministrator, useManager, useRestriction,
|
useAdministrator, useManager, useRestriction,
|
||||||
} from '../../common/util/permissions';
|
} from '../../common/util/permissions';
|
||||||
import useFeatures from '../../common/util/useFeatures';
|
import useFeatures from '../../common/util/useFeatures';
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
menuItemText: {
|
||||||
|
whiteSpace: 'nowrap',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const MenuItem = ({
|
const MenuItem = ({
|
||||||
title, link, icon, selected,
|
title, link, icon, selected,
|
||||||
}) => (
|
}) => {
|
||||||
|
const classes = useStyles();
|
||||||
|
return (
|
||||||
<ListItemButton key={link} component={Link} to={link} selected={selected}>
|
<ListItemButton key={link} component={Link} to={link} selected={selected}>
|
||||||
<ListItemIcon>{icon}</ListItemIcon>
|
<ListItemIcon>{icon}</ListItemIcon>
|
||||||
<ListItemText primary={title} sx={{ whiteSpace: 'nowrap' }} />
|
<ListItemText primary={title} className={classes.menuItemText} />
|
||||||
</ListItemButton>
|
</ListItemButton>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const SettingsMenu = () => {
|
const SettingsMenu = () => {
|
||||||
const t = useTranslation();
|
const t = useTranslation();
|
||||||
|
Loading…
Reference in New Issue
Block a user