fix: drawer for mobile view

This commit is contained in:
monoid 2023-06-01 13:28:00 +09:00
parent 65192c6c72
commit a2a2407af6
2 changed files with 11 additions and 3 deletions

View File

@ -97,6 +97,7 @@ export const ContentInfo = (props: {
[theme.breakpoints.down("sm")]: { [theme.breakpoints.down("sm")]: {
flexDirection: "column", flexDirection: "column",
alignItems: "center", alignItems: "center",
height: "auto",
} }
}} elevation={4}> }} elevation={4}>
<Link /*className={propclasses.thumbnail_anchor ?? thumbnail_anchor}*/ component={RouterLink} to={{ <Link /*className={propclasses.thumbnail_anchor ?? thumbnail_anchor}*/ component={RouterLink} to={{

View File

@ -57,11 +57,18 @@ const StyledInputBase = styled(InputBase)(({ theme }) => ({
}, },
})); }));
const StyledNav = styled('nav')(({theme}) => ({
[theme.breakpoints.up("sm")]: {
width: theme.spacing(7)
}
}));
const closedMixin = (theme: Theme) => ({ const closedMixin = (theme: Theme) => ({
overflowX: 'hidden', overflowX: 'hidden',
width: `calc(${theme.spacing(7)} + 1px)`, width: `calc(${theme.spacing(7)} + 1px)`,
}); });
export const Headline = (prop: { export const Headline = (prop: {
children?: React.ReactNode, children?: React.ReactNode,
classes?: { classes?: {
@ -169,7 +176,7 @@ export const Headline = (prop: {
</Toolbar> </Toolbar>
</AppBar> </AppBar>
{renderProfileMenu} {renderProfileMenu}
<nav style={{ width: theme.spacing(7) }}> <StyledNav>
<Hidden smUp implementation="css"> <Hidden smUp implementation="css">
<StyledDrawer variant="temporary" anchor='left' open={v} onClose={toggleV} <StyledDrawer variant="temporary" anchor='left' open={v} onClose={toggleV}
sx={{ sx={{
@ -179,7 +186,7 @@ export const Headline = (prop: {
{drawer_contents} {drawer_contents}
</StyledDrawer> </StyledDrawer>
</Hidden> </Hidden>
<Hidden xsDown implementation="css"> <Hidden smDown implementation="css">
<StyledDrawer variant='permanent' anchor='left' <StyledDrawer variant='permanent' anchor='left'
sx={{ sx={{
...closedMixin(theme), ...closedMixin(theme),
@ -188,7 +195,7 @@ export const Headline = (prop: {
{drawer_contents} {drawer_contents}
</StyledDrawer> </StyledDrawer>
</Hidden> </Hidden>
</nav> </StyledNav>
<main style={{ <main style={{
display: 'flex', display: 'flex',
flexFlow: 'column', flexFlow: 'column',