refactor: improve behaviour of edit mode when navigating away and back (#525)

This commit is contained in:
Meier Lukas authored and GitHub committed 2024-05-22 21:28:45 +02:00
1 parent 5a9e8edf70
commit e097cffe59
7 files changed
+30 -27

No files matched your search

@@ -1,8 +1,7 @@
import type { RefObject } from "react";
import { useAtomValue } from "jotai";
import type { EmptySection } from "~/app/[locale]/boards/_types";
import { editModeAtom } from "../editMode";
import { useEditMode } from "~/app/[locale]/boards/(content)/_context";
import { SectionContent } from "./content";
import { useGridstack } from "./gridstack/use-gridstack";
@@ -15,7 +14,7 @@ const defaultClasses = "grid-stack grid-stack-empty min-row";
export const BoardEmptySection = ({ section, mainRef }: Props) => {
const { refs } = useGridstack({ section, mainRef });
const isEditMode = useAtomValue(editModeAtom);
const [isEditMode] = useEditMode();
return (
<div