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

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

View File

@@ -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