Remove unused styles and dependencies from ProfileButton.js

master
Tudor Stanciu 2024-03-30 13:57:07 +02:00
parent b8019e62ef
commit add5ae2734
2 changed files with 3 additions and 42 deletions

View File

@ -7,15 +7,11 @@ import SettingsIcon from "@mui/icons-material/Settings";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { useTuitioClient } from "@flare/tuitio-client-react"; import { useTuitioClient } from "@flare/tuitio-client-react";
import { useToast } from "../../hooks"; import { useToast } from "../../hooks";
import { getStyles } from "./styles";
import { useTheme } from "@mui/material/styles";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
const ProfileButton = () => { const ProfileButton = () => {
const navigate = useNavigate(); const navigate = useNavigate();
const { error } = useToast(); const { error } = useToast();
const theme = useTheme();
const styles = getStyles(theme);
const { t } = useTranslation(); const { t } = useTranslation();
const { logout } = useTuitioClient({ const { logout } = useTuitioClient({
@ -66,7 +62,7 @@ const ProfileButton = () => {
handleClose(); handleClose();
}} }}
> >
<ListItemIcon sx={styles.menuItemIcon}> <ListItemIcon sx={{ minWidth: "26px" }}>
<AccountBoxIcon fontSize="small" /> <AccountBoxIcon fontSize="small" />
</ListItemIcon> </ListItemIcon>
<Typography variant="inherit">{t("User.Profile.Label")}</Typography> <Typography variant="inherit">{t("User.Profile.Label")}</Typography>
@ -77,13 +73,13 @@ const ProfileButton = () => {
handleClose(); handleClose();
}} }}
> >
<ListItemIcon sx={styles.menuItemIcon}> <ListItemIcon sx={{ minWidth: "26px" }}>
<SettingsIcon fontSize="small" /> <SettingsIcon fontSize="small" />
</ListItemIcon> </ListItemIcon>
<Typography variant="inherit">{t("User.Settings")}</Typography> <Typography variant="inherit">{t("User.Settings")}</Typography>
</MenuItem> </MenuItem>
<MenuItem onClick={logout}> <MenuItem onClick={logout}>
<ListItemIcon sx={styles.menuItemIcon}> <ListItemIcon sx={{ minWidth: "26px" }}>
<ExitToAppIcon fontSize="small" /> <ExitToAppIcon fontSize="small" />
</ListItemIcon> </ListItemIcon>
<Typography variant="inherit">{t("User.Logout")}</Typography> <Typography variant="inherit">{t("User.Logout")}</Typography>

View File

@ -1,35 +0,0 @@
const drawerWidth = 240;
const getStyles = theme => ({
appBar: {
zIndex: theme.zIndex.drawer + 1,
transition: theme.transitions.create(["width", "margin"], {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen
})
},
appBarShift: {
marginLeft: drawerWidth,
width: `calc(100% - ${drawerWidth}px)`,
transition: theme.transitions.create(["width", "margin"], {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.enteringScreen
})
},
menuButton: {
marginRight: 36
},
hide: {
display: "none"
},
drawer: {
width: drawerWidth,
flexShrink: 0,
whiteSpace: "nowrap"
},
menuItemIcon: {
minWidth: "26px"
}
});
export { getStyles };