mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-10-22 11:23:54 +00:00
Abstract LayoutContext
This commit is contained in:
19
src/context/LayoutContext.jsx
Normal file
19
src/context/LayoutContext.jsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { createContext, useState } from "react";
|
||||
|
||||
export const LayoutContext = createContext();
|
||||
|
||||
export default function LayoutContextProvider({ children }) {
|
||||
const [layout, setLayout] = useState({
|
||||
header: true,
|
||||
sidebar: true,
|
||||
issues: true,
|
||||
toolbar: true,
|
||||
fullscreen: false,
|
||||
});
|
||||
|
||||
return (
|
||||
<LayoutContext.Provider value={{ layout, setLayout }}>
|
||||
{children}
|
||||
</LayoutContext.Provider>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user