Refactor base app layout

This commit is contained in:
schroda
2024-07-11 17:22:52 +02:00
parent 31837392b5
commit f43b7af3cd
19 changed files with 443 additions and 288 deletions

View File

@@ -16,6 +16,9 @@ type ContextType = {
title: string | React.ReactNode;
setTitle: (title: ContextType['title'], browserTitle?: string) => void;
appBarHeight: number;
setAppBarHeight: React.Dispatch<React.SetStateAction<number>>;
// AppBar action buttons
action: any;
setAction: React.Dispatch<React.SetStateAction<any>>;
@@ -23,16 +26,34 @@ type ContextType = {
// Allow default navbar to be overrided
override: INavbarOverride;
setOverride: React.Dispatch<React.SetStateAction<INavbarOverride>>;
// NavBar
isCollapsed: boolean;
setIsCollapsed: React.Dispatch<React.SetStateAction<boolean>>;
navBarWidth: number;
setNavBarWidth: React.Dispatch<React.SetStateAction<number>>;
bottomBarHeight: number;
setBottomBarHeight: React.Dispatch<React.SetStateAction<number>>;
};
export const NavBarContext = React.createContext<ContextType>({
history: [],
title: 'Suwayomi',
setTitle: (): void => {},
appBarHeight: 0,
setAppBarHeight: (): void => {},
action: <div />,
setAction: (): void => {},
override: { status: false, value: <div /> },
setOverride: (): void => {},
isCollapsed: false,
setIsCollapsed: (): void => {},
navBarWidth: 0,
setNavBarWidth: (): void => {},
bottomBarHeight: 0,
setBottomBarHeight: (): void => {},
});
export const useNavBarContext = () => useContext(NavBarContext);