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)); 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); background-color: var(--mantine-color-blue-filled);
color: var(--mantine-color-white); 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 { Burger, Container, Group } from '@mantine/core';
import { useDisclosure } from '@mantine/hooks'; import { useDisclosure } from '@mantine/hooks';
import classes from './BarkHeader.module.css'; import classes from './BarkHeader.module.css';
import {NavLink} from "react-router";
const links = [ const links = [
{ link: '/', label: 'Home' }, { link: '/', label: 'Home' },
@@ -10,21 +11,12 @@ const links = [
export function BarkHeader() { export function BarkHeader() {
const [opened, { toggle }] = useDisclosure(false); const [opened, { toggle }] = useDisclosure(false);
const [active, setActive] = useState(links[0].link);
const items = links.map((link) => ( const items = links.map((link) => (
<a <NavLink className = {({ isActive }) =>
key={link.label} classes.link + ' ' + (isActive ? classes.active : '')} to={link.link} >
href={link.link}
className={classes.link}
data-active={active === link.link || undefined}
onClick={(event) => {
event.preventDefault();
setActive(link.link);
}}
>
{link.label} {link.label}
</a> </NavLink>
)); ));
return ( return (
@@ -2,6 +2,7 @@ import {useQuery} from "@tanstack/react-query";
import {Link} from "react-router"; import {Link} from "react-router";
import {InventoryItem} from "./types"; import {InventoryItem} from "./types";
import Button from "../../common/components/Button.tsx"; import Button from "../../common/components/Button.tsx";
import {BarkHeader} from "../../common/components/BarkHeader.tsx";
function InventoryList() { function InventoryList() {
@@ -26,6 +27,8 @@ function InventoryList() {
return ( return (
<> <>
<BarkHeader></BarkHeader>
<div> <div>
<h1 className={"text-brand"}>Inventory</h1> <h1 className={"text-brand"}>Inventory</h1>
</div> </div>