From f2f332582b1c7ab533db23816b95cdb0f7e0d74a Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 24 Oct 2023 07:33:07 +0100 Subject: [PATCH] navbar cleanup and auto select last used sort type --- src/components/Navbar.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 1e24c51..cbfbab8 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -43,20 +43,23 @@ function NavbarButton({ text, icon, href, children }: ButtonProps) { export default function Navbar() { const settingsStore = useStore(useSettingsStore, (state) => state); + const player = settingsStore?.player; + const lastUsedSortType = settingsStore?.lastUsedSortType.value; + return ( <>
- {settingsStore !== undefined && settingsStore.player && ( + {settingsStore !== undefined && player && ( } - href={`/player/${settingsStore.player.id}/scoresaber/top/1`} + href={`/player/${player?.id}/scoresaber/${lastUsedSortType}/1`} /> )} @@ -70,7 +73,7 @@ export default function Navbar() { key={friend.id} className="mt-2 bg-gray-500" text={friend.name} - url={`/player/${friend.id}/scoresaber/top/1`} + url={`/player/${friend.id}/scoresaber/${lastUsedSortType}/1`} icon={