FEAT: Sidebar update to include followed streamers & categories;

FEAT: Sidebar now alters page width on open/close (DynamicPageContent);
FIX: Properly disallow shortcut keys when typing in an input field;
This commit is contained in:
Chris-1010
2025-02-18 00:47:24 +00:00
parent 902c745065
commit fde7c70b54
14 changed files with 311 additions and 172 deletions

View File

@@ -0,0 +1,26 @@
import { createContext, useContext, useState, ReactNode } from "react";
interface SidebarContextType {
showSideBar: boolean;
setShowSideBar: (show: boolean) => void;
}
const SidebarContext = createContext<SidebarContextType | undefined>(undefined);
export function SidebarProvider({ children }: { children: ReactNode }) {
const [showSideBar, setShowSideBar] = useState(false);
return (
<SidebarContext.Provider value={{ showSideBar, setShowSideBar }}>
{children}
</SidebarContext.Provider>
);
}
export function useSidebar() {
const context = useContext(SidebarContext);
if (context === undefined) {
throw new Error("useSidebar must be used within a SidebarProvider");
}
return context;
}