imported logos, header displays logo based on whiteLabel

This commit is contained in:
Carter 2024-10-31 17:21:12 -06:00
parent 0d5d2e821f
commit 95a1ba486b
214 changed files with 290 additions and 193 deletions

View file

@ -2,23 +2,24 @@ import { AppBar, Box, IconButton, Theme, Toolbar } from "@mui/material";
import { Menu } from "@mui/icons-material";
import classNames from "classnames";
import { makeStyles } from "@mui/styles";
import { getSignatureAccentColour } from "../services/whiteLabel";
import { getDarkLogo, getLightLogo, getSignatureAccentColour, hasTransparentLogoBG, hideLogo } from "../services/whiteLabel";
import { Link } from "react-router-dom";
import { useThemeType } from "../hooks/useThemeType";
const useStyles = makeStyles((theme: Theme) => ({
appBar: {
// zIndex: 10, // TODO: make variables to keep zIndex consistent
zIndex: theme.zIndex.drawer + 1
},
toolbar: {
marginLeft: theme.spacing(0.5),
[theme.breakpoints.up("md")]: {
marginLeft: theme.spacing(1.5)
marginLeft: theme.spacing(1.5)
}
},
buttonContainer: {
marginRight: theme.spacing(0.5),
[theme.breakpoints.up("md")]: {
marginRight: theme.spacing(1.5)
marginRight: theme.spacing(1.5)
}
},
button: {
@ -27,6 +28,31 @@ const useStyles = makeStyles((theme: Theme) => ({
hide: {
display: "none"
},
logoContainer: {
display: "flex",
alignItems: "flex-end",
justifyContent: "flex-start"
},
logoLink: {
display: "flex",
justifyContent: "center",
alignItems: "center",
borderRadius: "5px",
backgroundColor: hasTransparentLogoBG()
? ""
: theme.palette.mode === "light"
? "#fff"
: "#323232"
},
HeaderLogo: {
objectFit: "cover",
height: "56px",
width: "auto",
padding: theme.spacing(1),
[theme.breakpoints.up("md")]: {
height: "64px"
}
},
}));
interface Props {
@ -40,6 +66,8 @@ interface Props {
export default function Header(props: Props) {
const { sideIsOpen, openSide} = props;
const themeType = useThemeType();
const classes = useStyles()
return (
@ -53,9 +81,20 @@ export default function Header(props: Props) {
onClick={openSide}
className={classNames(classes.button, sideIsOpen && classes.hide)}>
<Menu />
</IconButton>
</IconButton>
{/* )} */}
</Box>
<Box flexGrow={1} marginLeft={0.5}>
{!hideLogo() && (
<div className={classes.logoContainer}>
<img
className={classes.HeaderLogo}
src={themeType === "light" ? getDarkLogo() : getLightLogo()}
alt={import.meta.env.REACT_APP_WEBSITE_TITLE}
/>
</div>
)}
</Box>
</Toolbar>
</AppBar>
)