Refactor still working on UI changes

This commit is contained in:
2026-07-22 14:58:59 -07:00
parent 7568d0dba4
commit 9fbf22bc32
4 changed files with 43 additions and 24 deletions
+10 -6
View File
@@ -2,6 +2,7 @@ import { useRecipe, Button, Stack, Text, Flex } from "@chakra-ui/react"
import UserAvatarMenu from "./UserAvatarMenu.jsx"; import UserAvatarMenu from "./UserAvatarMenu.jsx";
import { NavLink } from "react-router-dom"; import { NavLink } from "react-router-dom";
import useAuthStore from "@/store/authStore"; import useAuthStore from "@/store/authStore";
import {SearchBar} from "@/components/dashboard/SearchBar.jsx";
// Import the asset properly so Vite can bundle it for any server // Import the asset properly so Vite can bundle it for any server
// import defaultAvatar from "@/assets/user_profile.svg"; // import defaultAvatar from "@/assets/user_profile.svg";
@@ -13,7 +14,8 @@ export default function Header() {
const { user } = useAuthStore(); const { user } = useAuthStore();
console.log(user); console.log(user);
const displayName = user ? (user.fullName || user.username) : "Loading..."; const displayName = user ? (user.firstName || user.username) : "Loading...";
const avatarname = user ? (user.fullName || user.username) : "Loading...";
const displayEmail = user?.email || "LDAP User"; const displayEmail = user?.email || "LDAP User";
@@ -23,15 +25,17 @@ export default function Header() {
{/*<Button as={NavLink} to="/home" color="color" variant="plain" textStyle="5xl" fontWeight="bold">*/} {/*<Button as={NavLink} to="/home" color="color" variant="plain" textStyle="5xl" fontWeight="bold">*/}
{/* VDAP*/} {/* VDAP*/}
{/*</Button>*/} {/*</Button>*/}
<SearchBar placeholder="Enter a volcano to search" size="sm" width="410px" />
{/* User Profile Section */} {/* User Profile Section */}
<Flex align="center" gap={3} pr={6}> <Flex align="center" gap={3} pr={6}>
<Stack gap="0" textAlign="right" cursor="default"> <Text color="color" fontWeight="bold" textStyle="md" >{displayName}</Text>
<Text color="color" fontWeight="bold" textStyle="lg">{displayName}</Text> {/*<Stack gap="0" textAlign="right" cursor="default">*/}
<Text color="fg.muted" textStyle="sm">{displayEmail}</Text> {/* <Text color="color" fontWeight="bold" textStyle="md" width="100%" >{displayName}</Text>*/}
</Stack> {/* <Text color="fg.muted" textStyle="sm">{displayEmail}</Text>*/}
{/*</Stack>*/}
<UserAvatarMenu <UserAvatarMenu
name={displayName} name={avatarname}
// avatar={user.avatar} // avatar={user.avatar}
/> />
</Flex> </Flex>
+3 -3
View File
@@ -40,15 +40,15 @@ export default function Sidebar() {
to="/home" to="/home"
color="color" color="color"
variant="plain" variant="plain"
textStyle={isOpen ? "5xl" : "4xl"} // Scale down slightly when closed
fontWeight="bold" fontWeight="bold"
height="auto" // Prevents the large text from squashing vertically height="auto" // Prevents the large text from squashing vertically
overflow="hidden" overflow="hidden"
px={0} px={0}
justifyContent={isOpen ? "flex-start" : "center"} // Center the 'V' when collapsed justifyContent={isOpen ? "center" : "center"} // Center the 'V' when collapsed
ml={isOpen ? 3 : 0} // Align with other buttons when open ml={isOpen ? 3 : 0} // Align with other buttons when open
textStyle={isOpen ? "4xl" : "3xl"} // Scale down slightly when closed
> >
{isOpen ? "VDAP" : "V"} {isOpen ? "🌋 VDAP" : "🌋"}
</Button> </Button>
{/* Menu Trigger */} {/* Menu Trigger */}
+2 -2
View File
@@ -28,7 +28,7 @@ export default function Home() {
<Flex direction="column" height="100%" width="100%"> <Flex direction="column" height="100%" width="100%">
{/* 2. 🛠️ SUB HEADER: Matches your original padding and background */} {/* 2. 🛠️ SUB HEADER: Matches your original padding and background */}
<Flex as="header" position="sticky" top="0" zIndex="dropdown" bg="base200" p={5} align="center" justify="space-between" width="100%"> <Flex as="header" position="sticky" top="0" zIndex="dropdown" bg="transparent" p={5} align="center" justify="space-between" width="100%">
{/* TABS CONTAINER - Replicates the Tabs.List line container */} {/* TABS CONTAINER - Replicates the Tabs.List line container */}
<Flex borderBottom="1px solid" borderColor="fg.muted" gap={2}> <Flex borderBottom="1px solid" borderColor="fg.muted" gap={2}>
@@ -48,7 +48,7 @@ export default function Home() {
<SettingsButton /> <SettingsButton />
</> </>
) : ( ) : (
<SearchBar placeholder="Enter a volcano to search" size="sm" width="210px" /> <SettingsButton />
)} )}
</HStack> </HStack>
+27 -12
View File
@@ -3,12 +3,10 @@ import { defineSlotRecipe, createSystem, defaultConfig, defineConfig, defineReci
// RECIPES // RECIPES
const headerRecipe = defineRecipe({ const headerRecipe = defineRecipe({
base: { base: {
bg: "{base200}", bg: "{transparent}",
color: "text", color: "text",
width: "100%", width: "100%",
height: "100%", height: "100%",
borderBottom: "1px solid",
borderBottomColor:"{border}",
display: "flex", display: "flex",
flexDirection: "row", flexDirection: "row",
justifyContent: "space-between", justifyContent: "space-between",
@@ -18,13 +16,13 @@ const headerRecipe = defineRecipe({
const dashboardRecipe = defineRecipe({ const dashboardRecipe = defineRecipe({
base: { base: {
bg: "{base200}" bg: "{testBackground}"
} }
}); });
const canvasRecipe = defineRecipe({ const canvasRecipe = defineRecipe({
base: { base: {
bg: "{base200}", bg: "{transparent}",
zIndex: "-1", zIndex: "-1",
color: "{text}" color: "{text}"
} }
@@ -34,22 +32,35 @@ const sidebarRecipe = defineSlotRecipe({
slots: ["root", "close_button", "buttons", "dark_mode_button"], slots: ["root", "close_button", "buttons", "dark_mode_button"],
base: { base: {
root: { root: {
bg: "{base200}", // 1. Semi-transparent backgrounds
borderRight: "1px solid", bg: { base: "linear-gradient(to bottom right, #BBBBBB4C, #FFFFFF4C)", _dark: "rgba(20, 20, 20, 0.4)" },
borderColor: "{border}",
// 2. The glass blur effect
backdropFilter: "blur(12px)",
WebkitBackdropFilter: "blur(12px)", // For Safari compatibility
// 3. Subtle semi-transparent borders to catch the light
border: "1px solid",
borderColor: { base: "rgba(255, 255, 255, 0.3)", _dark: "rgba(255, 255, 255, 0.1)" },
// Your existing layout properties
borderRadius: "2xl",
boxShadow: "0 4px 30px rgba(0, 0, 0, 0.1)", // A softer shadow helps the glass pop
width: "100%", width: "100%",
height: "100%", height: "calc(100% - 16px)",
margin: "8px",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
justifyContent: "start", justifyContent: "start",
alignItems: "start", alignItems: "start",
gap: 2, gap: 2,
p: 2, p: 2,
zIndex: 10,
}, },
buttons: { buttons: {
bg: "transparent", bg: "transparent",
_hover: {bg: "{primaryLt}", color: "{textInverted}"}, _hover: {bg: "{testButton}", color: "{textInverted}"},
"&.active": {bg: "{primary}", color: "{textInverted}"}, "&.active": {bg: "{testButton}", color: "{textInverted}"},
fontSize: "xl", fontSize: "xl",
color: {base: "{text}"}, color: {base: "{text}"},
variant: "ghost", variant: "ghost",
@@ -179,8 +190,12 @@ const config = defineConfig({
secondaryBG: { value: {base: "#EDF1F1", _dark: "#121212"}}, secondaryBG: { value: {base: "#EDF1F1", _dark: "#121212"}},
border: {value: {base: "#000000", _dark: "#cbcbcb84"}}, border: {value: {base: "#000000", _dark: "#cbcbcb84"}},
text: {value: {base: "#000000", _dark: "lightgrey"}}, text: {value: {base: "#000000", _dark: "lightgrey"}},
textInverted: {value: "white"}, textInverted: {value: "#000000"},
icon: {value: {base: "#000000", _dark: "lightgrey"}}, icon: {value: {base: "#000000", _dark: "lightgrey"}},
testBackground: { value: {base: "linear-gradient(to bottom right, #BBBBBB, #FFFFFF)", _dark: "#191613"} },
testSidebar: { value: {base: "#FBFBFB", _dark: "#272421"} },
testButton: { value: {base: "#FFFFFF", _dark: "#C09754"} },
}, },
}, },
tokens: { tokens: {