This commit is contained in:
2025-01-16 19:37:00 -06:00
parent ded5ec1137
commit 5e43e2abbd
3 changed files with 8 additions and 13 deletions
@@ -26,7 +26,7 @@
background-color: light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-6));
}
[data-mantine-color-scheme] &[data-active] {
[data-mantine-color-scheme] & .active {
background-color: var(--mantine-color-blue-filled);
color: var(--mantine-color-white);
}
+4 -12
View File
@@ -2,6 +2,7 @@ import { useState } from 'react';
import { Burger, Container, Group } from '@mantine/core';
import { useDisclosure } from '@mantine/hooks';
import classes from './BarkHeader.module.css';
import {NavLink} from "react-router";
const links = [
{ link: '/', label: 'Home' },
@@ -10,21 +11,12 @@ const links = [
export function BarkHeader() {
const [opened, { toggle }] = useDisclosure(false);
const [active, setActive] = useState(links[0].link);
const items = links.map((link) => (
<a
key={link.label}
href={link.link}
className={classes.link}
data-active={active === link.link || undefined}
onClick={(event) => {
event.preventDefault();
setActive(link.link);
}}
>
<NavLink className = {({ isActive }) =>
classes.link + ' ' + (isActive ? classes.active : '')} to={link.link} >
{link.label}
</a>
</NavLink>
));
return (
@@ -2,6 +2,7 @@ import {useQuery} from "@tanstack/react-query";
import {Link} from "react-router";
import {InventoryItem} from "./types";
import Button from "../../common/components/Button.tsx";
import {BarkHeader} from "../../common/components/BarkHeader.tsx";
function InventoryList() {
@@ -26,6 +27,8 @@ function InventoryList() {
return (
<>
<BarkHeader></BarkHeader>
<div>
<h1 className={"text-brand"}>Inventory</h1>
</div>