Abstract LayoutContext

This commit is contained in:
1ilit
2024-03-09 19:42:09 +02:00
parent c9ad695abb
commit 610e2fa5c5
12 changed files with 77 additions and 27 deletions

View File

@@ -15,17 +15,19 @@ import {
} from "../data/data";
import {
AreaContext,
LayoutContext,
SelectContext,
SettingsContext,
StateContext,
TabContext,
UndoRedoContext,
} from "../pages/Editor";
import useLayout from "../hooks/useLayout";
export default function Area(props) {
const [hovered, setHovered] = useState(false);
const [editField, setEditField] = useState({});
const { layout, setState } = useContext(LayoutContext);
const { setState } = useContext(StateContext);
const {layout} = useLayout();
const { settings } = useContext(SettingsContext);
const { tab, setTab } = useContext(TabContext);
const { updateArea, deleteArea } = useContext(AreaContext);