few more fixes

This commit is contained in:
Olivier Gagnon 2021-09-16 20:51:25 -04:00
parent b6924d6889
commit defaa2ccd6
2 changed files with 15 additions and 44 deletions

@ -62,7 +62,7 @@ import { Page, routing } from "../../ui/navigationTracking";
const drawerWidth = 240; const drawerWidth = 240;
const openedMixin = (theme: Theme): CSSObject => ({ const openedMixin = (theme: Theme): CSSObject => ({
width: drawerWidth, width: theme.spacing(31),
transition: theme.transitions.create("width", { transition: theme.transitions.create("width", {
easing: theme.transitions.easing.sharp, easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.enteringScreen, duration: theme.transitions.duration.enteringScreen,
@ -76,14 +76,14 @@ const closedMixin = (theme: Theme): CSSObject => ({
duration: theme.transitions.duration.leavingScreen, duration: theme.transitions.duration.leavingScreen,
}), }),
overflowX: "hidden", overflowX: "hidden",
width: `calc(${theme.spacing(7)} + 1px)`, width: `calc(${theme.spacing(2)} + 1px)`,
[theme.breakpoints.up("sm")]: { [theme.breakpoints.up("sm")]: {
width: `calc(${theme.spacing(9)} + 1px)`, width: `calc(${theme.spacing(7)} + 1px)`,
}, },
}); });
const Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== "open" })(({ theme, open }) => ({ const Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== "open" })(({ theme, open }) => ({
width: drawerWidth, width: theme.spacing(31),
flexShrink: 0, flexShrink: 0,
whiteSpace: "nowrap", whiteSpace: "nowrap",
boxSizing: "border-box", boxSizing: "border-box",
@ -99,30 +99,6 @@ const Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== "open"
const useStyles = makeStyles((theme: Theme) => const useStyles = makeStyles((theme: Theme) =>
createStyles({ createStyles({
drawer: {
width: theme.spacing(31),
flexShrink: 0,
display: "flex",
whiteSpace: "nowrap",
},
drawerOpen: {
width: theme.spacing(31),
transition: theme.transitions.create("width", {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.enteringScreen,
}),
},
drawerClose: {
transition: theme.transitions.create("width", {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen,
}),
overflowX: "hidden",
width: theme.spacing(7) + 1,
[theme.breakpoints.up("sm")]: {
width: theme.spacing(9) + 1,
},
},
active: { active: {
borderLeft: "3px solid " + colors.primary, borderLeft: "3px solid " + colors.primary,
}, },
@ -381,17 +357,19 @@ export function SidebarRoot(props: IProps): React.ReactElement {
<BBTheme> <BBTheme>
<Drawer open={open} anchor="left" variant="permanent"> <Drawer open={open} anchor="left" variant="permanent">
<ListItem button onClick={toggleDrawer}> <ListItem button onClick={toggleDrawer}>
<ListItemIcon>{!open ? <ChevronRightIcon /> : <ChevronLeftIcon />}</ListItemIcon> <ListItemIcon>
{!open ? <ChevronRightIcon color={"primary"} /> : <ChevronLeftIcon color={"primary"} />}
</ListItemIcon>
<ListItemText primary={<Typography color="primary">Bitburner v{CONSTANTS.Version}</Typography>} /> <ListItemText primary={<Typography color="primary">Bitburner v{CONSTANTS.Version}</Typography>} />
</ListItem> </ListItem>
<Divider /> <Divider />
<List> <List>
<ListItem button onClick={() => setHackingOpen((old) => !old)}> <ListItem button onClick={() => setHackingOpen((old) => !old)}>
<ListItemIcon> <ListItemIcon>
<ComputerIcon /> <ComputerIcon color={"primary"} />
</ListItemIcon> </ListItemIcon>
<ListItemText primary={<Typography color="primary">Hacking</Typography>} /> <ListItemText primary={<Typography color="primary">Hacking</Typography>} />
{hackingOpen ? <ExpandLessIcon /> : <ExpandMoreIcon />} {hackingOpen ? <ExpandLessIcon color={"primary"} /> : <ExpandMoreIcon color={"primary"} />}
</ListItem> </ListItem>
<Collapse in={hackingOpen} timeout="auto" unmountOnExit> <Collapse in={hackingOpen} timeout="auto" unmountOnExit>
<List> <List>
@ -473,10 +451,10 @@ export function SidebarRoot(props: IProps): React.ReactElement {
<Divider /> <Divider />
<ListItem button onClick={() => setCharacterOpen((old) => !old)}> <ListItem button onClick={() => setCharacterOpen((old) => !old)}>
<ListItemIcon> <ListItemIcon>
<AccountBoxIcon /> <AccountBoxIcon color={"primary"} />
</ListItemIcon> </ListItemIcon>
<ListItemText primary={<Typography color="primary">Character</Typography>} /> <ListItemText primary={<Typography color="primary">Character</Typography>} />
{characterOpen ? <ExpandLessIcon /> : <ExpandMoreIcon />} {characterOpen ? <ExpandLessIcon color={"primary"} /> : <ExpandMoreIcon color={"primary"} />}
</ListItem> </ListItem>
<Collapse in={characterOpen} timeout="auto" unmountOnExit> <Collapse in={characterOpen} timeout="auto" unmountOnExit>
<ListItem <ListItem
@ -572,10 +550,10 @@ export function SidebarRoot(props: IProps): React.ReactElement {
<Divider /> <Divider />
<ListItem button onClick={() => setWorldOpen((old) => !old)}> <ListItem button onClick={() => setWorldOpen((old) => !old)}>
<ListItemIcon> <ListItemIcon>
<PublicIcon /> <PublicIcon color={"primary"} />
</ListItemIcon> </ListItemIcon>
<ListItemText primary={<Typography color="primary">World</Typography>} /> <ListItemText primary={<Typography color="primary">World</Typography>} />
{worldOpen ? <ExpandLessIcon /> : <ExpandMoreIcon />} {worldOpen ? <ExpandLessIcon color={"primary"} /> : <ExpandMoreIcon color={"primary"} />}
</ListItem> </ListItem>
<Collapse in={worldOpen} timeout="auto" unmountOnExit> <Collapse in={worldOpen} timeout="auto" unmountOnExit>
<ListItem <ListItem
@ -700,10 +678,10 @@ export function SidebarRoot(props: IProps): React.ReactElement {
<Divider /> <Divider />
<ListItem button onClick={() => setHelpOpen((old) => !old)}> <ListItem button onClick={() => setHelpOpen((old) => !old)}>
<ListItemIcon> <ListItemIcon>
<LiveHelpIcon /> <LiveHelpIcon color={"primary"} />
</ListItemIcon> </ListItemIcon>
<ListItemText primary={<Typography color="primary">Help</Typography>} /> <ListItemText primary={<Typography color="primary">Help</Typography>} />
{helpOpen ? <ExpandLessIcon /> : <ExpandMoreIcon />} {helpOpen ? <ExpandLessIcon color={"primary"} /> : <ExpandMoreIcon color={"primary"} />}
</ListItem> </ListItem>
<Collapse in={helpOpen} timeout="auto" unmountOnExit> <Collapse in={helpOpen} timeout="auto" unmountOnExit>
<ListItem <ListItem

@ -175,13 +175,6 @@ export const theme = createTheme({
}, },
}, },
}, },
MuiSvgIcon: {
styleOverrides: {
root: {
color: colors.primary,
},
},
},
MuiDrawer: { MuiDrawer: {
styleOverrides: { styleOverrides: {
paper: { paper: {