Skip to content

Commit

Permalink
updated navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
day-mon committed Apr 28, 2024
1 parent f63a2f6 commit aad15eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/src/components/navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Link } from "./link";
import { Component, createSignal, For } from "solid-js";
import { Settings } from "~/components/settings.tsx";
import { useLocation } from '@solidjs/router';

interface Props {
theme: string;
Expand All @@ -15,6 +16,7 @@ interface Route {
export const Navbar: Component<Props> = (props: Props) => {
// let storedPreference = localStorage.getItem('theme');
const [theme, setTheme] = createSignal(props.theme);
const location = useLocation();

const changeTheme = (theme: string) => {
setTheme(theme);
Expand Down Expand Up @@ -43,7 +45,7 @@ export const Navbar: Component<Props> = (props: Props) => {
{route => (
<Link
href={route.path}
class="text-sm font-medium hover:underline underline-offset-4"
class={`font-medium hover:underline underline-offset-4 ${location.pathname === route.path ? 'font-extrabold' : ''}`}
>
{route.display}
</Link>
Expand Down

0 comments on commit aad15eb

Please sign in to comment.