Files
spacedrive/interface/app/$libraryId/PageLayout.tsx
Jamie Pine 6d6e9c2dd7 [ENG-624] Explorer order by (#831)
added order by + fixed explorer padding situation
2023-05-19 15:51:17 +00:00

25 lines
711 B
TypeScript

import { RefObject, createContext, useContext, useRef } from 'react';
import { Outlet } from 'react-router';
import { TOP_BAR_HEIGHT } from './TopBar';
const PageContext = createContext<{ ref: RefObject<HTMLDivElement> } | undefined>(undefined);
export const usePageLayout = () => useContext(PageContext);
export const Component = () => {
const ref = useRef<HTMLDivElement>(null);
return (
<div
ref={ref}
className="custom-scroll page-scroll app-background flex h-screen w-full flex-col"
style={{ paddingTop: TOP_BAR_HEIGHT }}
>
<PageContext.Provider value={{ ref }}>
<div className="flex h-screen w-full flex-col">
<Outlet />
</div>
</PageContext.Provider>
</div>
);
};