mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-04-22 23:48:26 -04:00
* v1 * Update pnpm-lock.yaml * Update store.ts * Update index.tsx * fix animation * toggle_sidebar * locales
19 lines
437 B
TypeScript
19 lines
437 B
TypeScript
import { createContext, useContext } from 'react';
|
|
|
|
interface SidebarContextProps {
|
|
show: boolean;
|
|
locked: boolean;
|
|
collapsed: boolean;
|
|
onLockedChange: (val: boolean) => void;
|
|
}
|
|
|
|
export const SidebarContext = createContext<SidebarContextProps | null>(null);
|
|
|
|
export const useSidebarContext = () => {
|
|
const ctx = useContext(SidebarContext);
|
|
|
|
if (ctx === null) throw new Error('SidebarContext.Provider not found!');
|
|
|
|
return ctx;
|
|
};
|