Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions frontend/src/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import { useAuth } from '@/hooks/users';
import { Flex } from '@radix-ui/themes';
import NotificationsPopover from 'components/NotificationsPopover';
import ThemeToggle from 'components/ThemeToggle';
import { useTheme } from 'next-themes';
import { NavigationMenu } from 'radix-ui';
import { TbUserCircle } from 'react-icons/tb';
import { NavLink, useLocation } from 'react-router';
import { twMerge } from 'tailwind-merge';

export default function NavBar() {
const logout = () => {
Expand All @@ -20,7 +18,6 @@ export default function NavBar() {
const { isAuthenticated, isUnauthenticated, user } = useAuth();

const location = useLocation();
const { theme } = useTheme(); // Drop Content wouldn't obey otherwise

const defaultLinkClass = `
h-full
Expand Down Expand Up @@ -54,14 +51,8 @@ export default function NavBar() {
shadow-lg
border-(--gray-a6)
border-1
`;

const contentLight = `
bg-white
text-(--gray-a11)
`;

const contentDark = `
dark:bg-black
dark:text-(--gray-12)
`;
Expand Down Expand Up @@ -111,7 +102,7 @@ export default function NavBar() {
{isAuthenticated && (
<NotificationsPopover
triggerClassName={defaultLinkClass}
contentClassName={twMerge(contentBase, theme === 'dark' ? contentDark : contentLight)}
contentClassName={contentBase}
/>
)}

Expand All @@ -127,7 +118,7 @@ export default function NavBar() {
</Flex>
</NavigationMenu.Trigger>
<NavigationMenu.Content
className={twMerge(contentBase, theme === 'dark' ? contentDark : contentLight)}
className={contentBase}
onPointerEnter={(event) => event.preventDefault()}
onPointerLeave={(event) => event.preventDefault()}
>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import "@radix-ui/themes/styles.css";
@import "tailwindcss";
@custom-variant dark (&:where(.dark, .dark *));
@import "assets/fonts/inter/inter.css";

:root {
Expand Down
Loading