Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/components/layout/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ export default function Header(): React.ReactElement {
const { data: session, status } = useSession();
const role = session?.user?.role;
const canCreate = role === "admin" || role === "manager";
const headerColor = { admin: "#36385C", manager: "#9A9866" };
const fontColor = { admin: "#ffffff", manager: "#22305B" };
const appBarSx =
role && role in headerColor
? { backgroundColor: headerColor[role as keyof typeof headerColor] }
: { backgroundColor: "#fff" };

return (
<Box
Expand All @@ -26,7 +32,7 @@ export default function Header(): React.ReactElement {
zIndex: 10,
}}
>
<AppBar position="static" color="default">
<AppBar position="static" sx={appBarSx}>
<Toolbar
sx={{
width: "100%",
Expand Down Expand Up @@ -74,9 +80,9 @@ export default function Header(): React.ReactElement {
display: { xs: "none", md: "flex" },
fontSize: ".9rem",
fontWeight: 700,
color: "#22305B",
textDecoration: "none",
flexGrow: 1,
color: fontColor[role as keyof typeof fontColor] || "#22305B",
}}
>
THRIVE
Expand Down
Loading