2026-01-30 19:02:31 +00:00
|
|
|
import { chakra, useRecipe, Box, Button, Stack, Text, Flex, Image } from "@chakra-ui/react"
|
|
|
|
|
import { useColorMode } from "@/components/ui/color-mode";
|
2025-07-21 11:33:44 -07:00
|
|
|
import UserAvatarMenu from "./UserAvatarMenu.jsx";
|
|
|
|
|
|
|
|
|
|
//TODO: Dynamically populate per each user
|
|
|
|
|
const user = {
|
2026-01-30 19:02:31 +00:00
|
|
|
name: "Dan Hansen",
|
|
|
|
|
email: "dshansen@contractor.usgs.gov",
|
2025-07-21 11:33:44 -07:00
|
|
|
// avatar: "src\\assets\\user_profile.svg"
|
|
|
|
|
}
|
2025-07-16 15:02:57 -07:00
|
|
|
|
2025-07-31 13:23:11 -07:00
|
|
|
export default function Header({ onChangeView }) {
|
2025-07-16 15:02:57 -07:00
|
|
|
const recipe = useRecipe({ key: "header" });
|
|
|
|
|
const styles = recipe();
|
2026-01-30 19:02:31 +00:00
|
|
|
const { colorMode } = useColorMode();
|
|
|
|
|
|
|
|
|
|
const logoSource =
|
|
|
|
|
colorMode === "dark"
|
|
|
|
|
? "/images/NVIS_Logo_Black.png"
|
|
|
|
|
: "/images/NVIS_Logo_transparent.png"
|
2025-07-16 15:02:57 -07:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<chakra.div css={styles}>
|
2026-01-30 19:02:31 +00:00
|
|
|
<Button
|
|
|
|
|
onClick={() => onChangeView("mydashboard")}
|
|
|
|
|
// color="color"
|
|
|
|
|
variant="plain"
|
|
|
|
|
// textStyle="5xl"
|
|
|
|
|
// fontWeight="bold"
|
|
|
|
|
>
|
|
|
|
|
<Image src={ logoSource } alt="NVIS Logo" h="60px" />
|
|
|
|
|
</Button>
|
2025-07-17 11:03:55 -07:00
|
|
|
<Flex align="center" gap={3} pr={6}>
|
2025-07-30 08:34:07 -07:00
|
|
|
<Stack gap="0" textAlign="center" cursor="default">
|
2025-07-17 11:03:55 -07:00
|
|
|
<Text color="color" fontWeight="bold" textStyle="lg">{user.name}</Text>
|
|
|
|
|
<Text color="fg.muted" textStyle="sm">{user.email}</Text>
|
|
|
|
|
</Stack>
|
2025-07-29 14:47:03 -07:00
|
|
|
<UserAvatarMenu
|
|
|
|
|
name={user.name}
|
|
|
|
|
avatar={user.avatar}
|
2025-07-31 12:23:45 -07:00
|
|
|
onChangeView={ onChangeView }
|
2025-07-29 14:47:03 -07:00
|
|
|
/>
|
2025-07-17 11:03:55 -07:00
|
|
|
</Flex>
|
2025-07-16 15:02:57 -07:00
|
|
|
</chakra.div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|