Skip to content

Commit

Permalink
feat: Center header for large screens
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Nov 4, 2022
1 parent e027c38 commit 8700f25
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions app/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,35 +68,40 @@ export const HeaderBorder = () => {
);
};

const useHeaderStyles = makeStyles<Theme>((theme) => ({
wrapper: {
position: "fixed",
top: 0,
left: 0,
width: "100%",
overflowY: "hidden",
zIndex: 13,
backgroundColor: theme.palette.grey[100],
},
content: {
minHeight: 92,
maxWidth: 1400,
marginLeft: "auto",
marginRight: "auto",
color: theme.palette.grey[700],
},
}));

export const Header = ({
pageType = "app",
}: {
pageType?: "content" | "app";
}) => {
const classes = useHeaderStyles();

return (
<Box
sx={
pageType == "content"
? undefined
: {
position: "fixed",
top: 0,
left: 0,
width: "100%",
overflowY: "hidden",
zIndex: 13,
}
}
>
<Box className={pageType === "app" ? classes.wrapper : undefined}>
<Flex
component="header"
className={classes.content}
sx={{
px: [0, 4, 4],
pt: [0, 3, 3],
minHeight: 92,

backgroundColor: "grey.100",
color: "grey.700",
flexDirection: ["column", "row"],
}}
>
Expand Down

0 comments on commit 8700f25

Please sign in to comment.