Skip to content

Commit e7042e6

Browse files
fix(site): fix navbar hover (#10021)
1 parent c194119 commit e7042e6

File tree

1 file changed

+33
-40
lines changed

1 file changed

+33
-40
lines changed

site/src/components/Dashboard/Navbar/NavbarView.tsx

Lines changed: 33 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import Drawer from "@mui/material/Drawer";
22
import IconButton from "@mui/material/IconButton";
3-
import List from "@mui/material/List";
4-
import ListItem from "@mui/material/ListItem";
53
import MenuIcon from "@mui/icons-material/Menu";
64
import { CoderIcon } from "components/Icons/CoderIcon";
75
import { type FC, type ReactNode, useRef, useState } from "react";
@@ -108,12 +106,17 @@ const styles = {
108106
text-decoration: none;
109107
transition: background-color 0.15s ease-in-out;
110108
109+
&.active {
110+
color: ${theme.palette.text.primary};
111+
font-weight: 500;
112+
}
113+
111114
&:hover {
112-
background-color: theme.palette.action.hover;
115+
background-color: ${theme.palette.action.hover};
113116
}
114117
115118
${theme.breakpoints.up("md")} {
116-
height: ${navHeight};
119+
height: ${navHeight}px;
117120
padding: 0 ${theme.spacing(3)};
118121
}
119122
`,
@@ -134,48 +137,38 @@ const NavItems: React.FC<NavItemsProps> = (props) => {
134137
const theme = useTheme();
135138

136139
return (
137-
<List css={{ padding: 0 }} className={className}>
138-
<ListItem button css={styles.item}>
139-
<NavLink
140-
css={[
141-
styles.link,
142-
location.pathname.startsWith("/@") && {
143-
color: theme.palette.text.primary,
144-
fontWeight: 500,
145-
},
146-
]}
147-
to="/workspaces"
148-
>
149-
{Language.workspaces}
150-
</NavLink>
151-
</ListItem>
152-
<ListItem button css={styles.item}>
153-
<NavLink css={styles.link} to="/templates">
154-
{Language.templates}
155-
</NavLink>
156-
</ListItem>
140+
<nav className={className}>
141+
<NavLink
142+
css={[
143+
styles.link,
144+
location.pathname.startsWith("/@") && {
145+
color: theme.palette.text.primary,
146+
fontWeight: 500,
147+
},
148+
]}
149+
to="/workspaces"
150+
>
151+
{Language.workspaces}
152+
</NavLink>
153+
<NavLink css={styles.link} to="/templates">
154+
{Language.templates}
155+
</NavLink>
157156
{canViewAllUsers && (
158-
<ListItem button css={styles.item}>
159-
<NavLink css={styles.link} to={USERS_LINK}>
160-
{Language.users}
161-
</NavLink>
162-
</ListItem>
157+
<NavLink css={styles.link} to={USERS_LINK}>
158+
{Language.users}
159+
</NavLink>
163160
)}
164161
{canViewAuditLog && (
165-
<ListItem button css={styles.item}>
166-
<NavLink css={styles.link} to="/audit">
167-
{Language.audit}
168-
</NavLink>
169-
</ListItem>
162+
<NavLink css={styles.link} to="/audit">
163+
{Language.audit}
164+
</NavLink>
170165
)}
171166
{canViewDeployment && (
172-
<ListItem button css={styles.item}>
173-
<NavLink css={styles.link} to="/deployment/general">
174-
{Language.deployment}
175-
</NavLink>
176-
</ListItem>
167+
<NavLink css={styles.link} to="/deployment/general">
168+
{Language.deployment}
169+
</NavLink>
177170
)}
178-
</List>
171+
</nav>
179172
);
180173
};
181174
export const NavbarView: FC<NavbarViewProps> = ({

0 commit comments

Comments
 (0)