feat(draw): when first time transfer to board mode, use page width as editor shape's width

This commit is contained in:
alt0
2022-08-02 18:50:49 +08:00
parent efa23c806a
commit a73651817e
4 changed files with 36 additions and 56 deletions

View File

@@ -26,3 +26,13 @@ export const useCurrentEditors = () => {
setCurrentEditors,
};
};
// when first time transfer doc to board, need init the editor shape size to page size.
const _pageClientWidth = atom<number>(1020);
export const usePageClientWidth = () => {
const [pageClientWidth, setPageClientWidth] = useAtom(_pageClientWidth);
return {
pageClientWidth,
setPageClientWidth,
};
};