From abebc0bb086a68583ce83004adc31cf88fbb0399 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Tue, 10 Feb 2026 14:23:37 -0700 Subject: [PATCH] Add categories to sidebar --- src/app/GlobalProvider.tsx | 2 + src/app/componets/Sidebar.tsx | 113 +++++++++++++++++++++++++++------- src/app/game/page.tsx | 14 ++--- src/app/layout.tsx | 6 +- src/app/page.tsx | 14 +++-- 5 files changed, 110 insertions(+), 39 deletions(-) diff --git a/src/app/GlobalProvider.tsx b/src/app/GlobalProvider.tsx index 0e4bebc..f5e54f9 100644 --- a/src/app/GlobalProvider.tsx +++ b/src/app/GlobalProvider.tsx @@ -43,6 +43,8 @@ type GlobalCtxType = { viewingInfoFromDownloads: boolean version: string | null downloadVersions: (list: string[]) => Promise + category: number + setCategory: Dispatch> } const GlobalCtx = createContext(null) diff --git a/src/app/componets/Sidebar.tsx b/src/app/componets/Sidebar.tsx index 95662d9..ec2753b 100644 --- a/src/app/componets/Sidebar.tsx +++ b/src/app/componets/Sidebar.tsx @@ -8,16 +8,18 @@ import { faCog, faDownload, faGamepad, - faHexagonNodes + faHexagonNodes, + faLayerGroup } from '@fortawesome/free-solid-svg-icons' import { faDiscord } from '@fortawesome/free-brands-svg-icons' import { platform } from '@tauri-apps/plugin-os' import { useGlobal } from '../GlobalProvider' import Image from 'next/image' import Link from 'next/link' -import { usePathname, useSearchParams } from 'next/navigation' +import { usePathname, useRouter, useSearchParams } from 'next/navigation' import { getCurrentWindow } from '@tauri-apps/api/window' import { Lexend } from 'next/font/google' +import React from 'react' const lexend = Lexend({ subsets: ['latin'] @@ -30,11 +32,16 @@ export default function Sidebar () { setShowPopup, setPopupMode, setFadeOut, - downloadProgress + downloadProgress, + downloadedVersionsConfig, + getVersionInfo, + category, + setCategory } = useGlobal() const pathname = usePathname() const params = useSearchParams() + const router = useRouter() return (