Skip to content

Commit 8af1422

Browse files
committed
feat: improve main nav
1 parent d6efbff commit 8af1422

6 files changed

Lines changed: 43 additions & 44 deletions

File tree

apps/web/src/app/metrics-and-insights/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const MetricsAndInsightsPage = () => {
8181
]}
8282
/>
8383
<FilterMultiSelect
84-
label="Owner"
84+
label="Team"
8585
icon={IconTeam}
8686
asyncController={useTeamAsyncOptions}
8787
withSearch

apps/web/src/components/app-shell/app-shell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const AppShell = ({ children }: Props) => {
2525
}}
2626
layout={isSmallScreen ? "default" : "alt"}
2727
navbar={{
28-
width: hasSubnav ? 330 : 80,
28+
width: hasSubnav ? 330 : 91,
2929
breakpoint: "sm",
3030
collapsed: { desktop: false, mobile: !isMobileNavOpen },
3131
}}

apps/web/src/components/navbar/navbar-item.module.css

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
}
44

55
.button {
6-
padding: 13px !important;
76
border-radius: var(--mantine-radius-md);
87
display: flex;
98
align-items: center;
@@ -15,27 +14,22 @@
1514
}
1615

1716
.label {
18-
color: var(--mantine-color-dark-1);
19-
padding-left: 8px;
17+
color: var(--mantine-color-dark-1) !important;
2018
}
2119

22-
.button:hover {
23-
background-color: var(--mantine-color-gray-light-hover) !important;
20+
.button:not(.active):hover .label {
21+
color: var(--mantine-color-green-3) !important;
2422
}
2523

26-
.active {
27-
background-color: var(--mantine-color-green-light-hover) !important;
24+
.button:not(.active):hover .icon {
25+
color: var(--mantine-color-green-3) !important;
2826
}
2927

3028
.active .label {
31-
color: var(--mantine-color-green-2);
29+
color: var(--mantine-color-green-3) !important;
3230
}
3331

3432
.active svg,
3533
.active:hover {
36-
color: var(--mantine-color-green-2);
37-
}
38-
39-
.active:hover {
40-
background-color: var(--mantine-color-green-light-hover) !important;
34+
color: var(--mantine-color-green-3);
4135
}

apps/web/src/components/navbar/navbar-item.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Tooltip, UnstyledButton } from "@mantine/core";
1+
import { UnstyledButton, Text, Stack } from "@mantine/core";
22
import type { Icon } from "@tabler/icons-react";
33
import { Link } from "react-router-dom";
44
import classes from "./navbar-item.module.css";
@@ -19,18 +19,19 @@ export const NavbarItem = ({
1919
onClick,
2020
}: NavbarItemProps) => {
2121
const button = (
22-
<Tooltip
23-
label={label}
24-
position="right"
25-
transitionProps={{ duration: 0 }}
22+
<UnstyledButton
23+
py="xs"
24+
className={`${classes.button} ${active ? classes.active : ""}`}
25+
w="80px"
2626
onClick={onClick}
2727
>
28-
<UnstyledButton
29-
className={`${classes.button} ${active ? classes.active : ""}`}
30-
>
31-
<Icon stroke={1.5} />
32-
</UnstyledButton>
33-
</Tooltip>
28+
<Stack gap={5} align="center">
29+
<Icon stroke={1.5} className={classes.icon} />
30+
<Text fz="sm" className={classes.label}>
31+
{label}
32+
</Text>
33+
</Stack>
34+
</UnstyledButton>
3435
);
3536

3637
if (href) {

apps/web/src/components/navbar/navbar.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ export const Navbar = ({ closeMobileNav }: NavbarProps) => {
2929
>
3030
<Stack
3131
gap={5}
32-
p="md"
33-
maw={80}
32+
py="md"
33+
px={5}
34+
w={90}
3435
style={{ flexGrow: 1 }}
3536
align="center"
3637
>
@@ -42,18 +43,21 @@ export const Navbar = ({ closeMobileNav }: NavbarProps) => {
4243
style={{ marginBottom: 24 }}
4344
/>
4445
{navItems.map((link) => (
45-
<NavbarItem
46-
{...link}
47-
active={
48-
pathname === link.href ||
49-
(link.href != "/" && pathname.startsWith(link.href || ""))
50-
}
51-
key={link.label}
52-
onClick={() => closeMobileNav()}
53-
/>
46+
<div key={link.label}>
47+
<NavbarItem
48+
{...link}
49+
active={
50+
pathname === link.href ||
51+
(link.href != "/" && pathname.startsWith(link.href || ""))
52+
}
53+
key={link.label}
54+
label={link.label}
55+
onClick={() => closeMobileNav()}
56+
/>
57+
</div>
5458
))}
5559
</Stack>
56-
<Stack justify="center" align="center" p="md" maw={80}>
60+
<Stack justify="center" align="center" p="md" maw={90}>
5761
<NavbarItem
5862
label="Settings"
5963
icon={IconSettings}

apps/web/src/providers/nav.provider.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@ export const navItems: (Omit<NavbarItemProps, "href"> & {
1414
href: string;
1515
})[] = [
1616
{ icon: IconHome2, label: "Home", href: "/" },
17-
{
18-
icon: IconChartPie,
19-
label: "Metrics & Insights",
20-
href: "/metrics-and-insights",
21-
},
2217
{
2318
icon: IconUser,
2419
label: "Humans",
2520
href: "/humans",
2621
},
22+
{
23+
icon: IconChartPie,
24+
label: "Metrics",
25+
href: "/metrics-and-insights",
26+
},
2727
{
2828
icon: IconStack3,
2929
label: "Systems",
3030
href: "/systems",
3131
},
3232
{
3333
icon: IconBolt,
34-
label: "Automations",
34+
label: "Automate",
3535
href: "/automations",
3636
},
3737
];

0 commit comments

Comments
 (0)