fix(website): navigation and 404

This commit is contained in:
iCrawl
2023-04-11 19:19:33 +02:00
parent dcf8757d35
commit 78e02c4b63
8 changed files with 40 additions and 33 deletions

View File

@@ -1,9 +0,0 @@
'use client';
import { useUnregisterServiceWorker } from '~/hooks/useUnregisterServiceWorker';
export function ServiceWorker() {
useUnregisterServiceWorker();
return null;
}

View File

@@ -7,7 +7,7 @@ import { VscSymbolField } from '@react-icons/all-files/vsc/VscSymbolField';
import { VscSymbolInterface } from '@react-icons/all-files/vsc/VscSymbolInterface';
import { VscSymbolMethod } from '@react-icons/all-files/vsc/VscSymbolMethod';
import { VscSymbolVariable } from '@react-icons/all-files/vsc/VscSymbolVariable';
import { usePathname } from 'next/navigation';
import { useSelectedLayoutSegment } from 'next/navigation';
import { useMemo } from 'react';
import { ItemLink } from './ItemLink';
import { Section } from './Section';
@@ -83,7 +83,7 @@ function resolveIcon(item: string) {
}
export function Sidebar({ members }: { members: SidebarSectionItemData[] }) {
const pathname = usePathname();
const segment = useSelectedLayoutSegment();
const { setOpened } = useNav();
const groupItems = useMemo(() => groupMembers(members), [members]);
@@ -97,7 +97,7 @@ export function Sidebar({ members }: { members: SidebarSectionItemData[] }) {
{groupItems[group].map((member, index) => (
<ItemLink
className={`dark:border-dark-100 border-light-800 focus:ring-width-2 focus:ring-blurple ml-5 flex flex-col border-l p-[5px] pl-6 outline-0 focus:rounded focus:border-0 focus:ring ${
pathname === member.href
decodeURIComponent(segment ?? '') === member.href
? 'bg-blurple text-white'
: 'dark:hover:bg-dark-200 dark:active:bg-dark-100 hover:bg-light-700 active:bg-light-800'
}`}

View File

@@ -1,9 +0,0 @@
'use client';
import { useSystemThemeFallback } from '~/hooks/useSystemThemeFallback';
export function SystemThemeFallback() {
useSystemThemeFallback();
return null;
}