mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-09-19 22:14:50 +00:00
Abstract LayoutContext
This commit is contained in:
13
src/hooks/useLayout.js
Normal file
13
src/hooks/useLayout.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { useContext } from "react";
|
||||
import { LayoutContext } from "../context/LayoutContext";
|
||||
|
||||
/**
|
||||
* Access layout state
|
||||
*
|
||||
* Layout includes: header, sidebar, toolbar, issues, fullscreen
|
||||
*
|
||||
* @returns `{ layout, setLayout }`
|
||||
*/
|
||||
export default function useLayout() {
|
||||
return useContext(LayoutContext);
|
||||
}
|
Reference in New Issue
Block a user