2026-06-08 15:57:40 -07:00
|
|
|
import { HStack, Flex, Box } from "@chakra-ui/react";
|
|
|
|
|
import { NavLink, Outlet, useLocation } from "react-router-dom";
|
2025-08-05 12:57:18 -07:00
|
|
|
import { SearchBar } from "../CanvasComponents/SearchBar";
|
2026-06-09 14:06:01 -07:00
|
|
|
import { SettingsButton } from "../../SettingsButton.jsx";
|
2025-08-06 16:27:08 -07:00
|
|
|
|
2026-06-04 15:30:01 -07:00
|
|
|
export default function Home() {
|
2026-06-08 15:57:40 -07:00
|
|
|
const location = useLocation();
|
|
|
|
|
const isPersonalDashboard = location.pathname === "/home" || location.pathname === "/home/";
|
2026-06-04 15:30:01 -07:00
|
|
|
|
2026-06-09 14:06:01 -07:00
|
|
|
// 1. CSS making this look like how we want it, TODO turn to theme?
|
2026-06-08 15:57:40 -07:00
|
|
|
const tabStyles = {
|
|
|
|
|
fontSize: "lg",
|
|
|
|
|
fontWeight: "normal",
|
|
|
|
|
color: "fg.muted",
|
|
|
|
|
px: 4, // Horizontal padding
|
|
|
|
|
py: 2, // Vertical padding
|
|
|
|
|
borderBottom: "2px solid transparent",
|
|
|
|
|
mb: "-2px", // 🔥 The trick: Pulls the active border down to overlap the container's line
|
|
|
|
|
transition: "all 0.2s",
|
|
|
|
|
_hover: { color: "fg" },
|
|
|
|
|
_activeLink: {
|
|
|
|
|
color: "color", // Or whatever your primary text color is
|
|
|
|
|
borderColor: "currentColor", // The active underline
|
2026-06-04 15:30:01 -07:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-07-24 08:52:20 -07:00
|
|
|
return (
|
2026-06-08 15:57:40 -07:00
|
|
|
<Flex direction="column" height="100%" width="100%">
|
|
|
|
|
|
|
|
|
|
{/* 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%">
|
|
|
|
|
|
|
|
|
|
{/* TABS CONTAINER - Replicates the Tabs.List line container */}
|
|
|
|
|
<Flex borderBottom="2px solid" borderColor="border.muted" gap={2}>
|
|
|
|
|
<Box as={NavLink} to="/home" end css={tabStyles}>My Dashboard</Box>
|
|
|
|
|
<Box as={NavLink} to="/home/gas" css={tabStyles}>Gas</Box>
|
|
|
|
|
<Box as={NavLink} to="/home/seismic" css={tabStyles}>Seismic</Box>
|
|
|
|
|
<Box as={NavLink} to="/home/remote" css={tabStyles}>Remote Sensing</Box>
|
|
|
|
|
<Box as={NavLink} to="/home/daily" css={tabStyles}>Daily Activity</Box>
|
|
|
|
|
</Flex>
|
|
|
|
|
|
|
|
|
|
{/* EDIT MODE BUTTONS & CONTROLS */}
|
|
|
|
|
<HStack width="258px" justifyContent="flex-end">
|
|
|
|
|
{isPersonalDashboard ? (
|
|
|
|
|
<>
|
|
|
|
|
<SearchBar placeholder="Enter a volcano to search" size="sm" width="210px" />
|
|
|
|
|
{/* This will eventually trigger your Zustand store's edit mode! */}
|
|
|
|
|
<SettingsButton />
|
|
|
|
|
</>
|
|
|
|
|
) : (
|
|
|
|
|
<SearchBar placeholder="Enter a volcano to search" size="sm" width="210px" />
|
|
|
|
|
)}
|
|
|
|
|
</HStack>
|
|
|
|
|
|
|
|
|
|
</Flex>
|
|
|
|
|
|
|
|
|
|
{/* 3. 🛠️ CANVAS AREA */}
|
|
|
|
|
<Flex flex="1" overflow="auto">
|
|
|
|
|
<Outlet />
|
|
|
|
|
</Flex>
|
2026-06-04 15:30:01 -07:00
|
|
|
|
2025-07-24 08:52:20 -07:00
|
|
|
</Flex>
|
|
|
|
|
);
|
|
|
|
|
}
|