mirror of
https://github.com/docmost/docmost.git
synced 2025-11-19 03:02:09 +10:00
remove clickoutside hook for now
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from "react";
|
import React from "react";
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Affix,
|
Affix,
|
||||||
@ -30,7 +30,6 @@ import {
|
|||||||
import { IconList } from "@tabler/icons-react";
|
import { IconList } from "@tabler/icons-react";
|
||||||
import { useToggleToc } from "@/features/share/hooks/use-toggle-toc.ts";
|
import { useToggleToc } from "@/features/share/hooks/use-toggle-toc.ts";
|
||||||
import classes from "./share.module.css";
|
import classes from "./share.module.css";
|
||||||
import { useClickOutside } from "@mantine/hooks";
|
|
||||||
|
|
||||||
const MemoizedSharedTree = React.memo(SharedTree);
|
const MemoizedSharedTree = React.memo(SharedTree);
|
||||||
|
|
||||||
@ -54,18 +53,6 @@ export default function ShareShell({
|
|||||||
const { data } = useGetSharedPageTreeQuery(shareId);
|
const { data } = useGetSharedPageTreeQuery(shareId);
|
||||||
const readOnlyEditor = useAtomValue(readOnlyEditorAtom);
|
const readOnlyEditor = useAtomValue(readOnlyEditorAtom);
|
||||||
|
|
||||||
const [navbarOutside, setNavbarOutside] = useState<HTMLElement | null>(null);
|
|
||||||
|
|
||||||
useClickOutside(
|
|
||||||
() => {
|
|
||||||
if (mobileOpened) {
|
|
||||||
toggleMobile();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
null,
|
|
||||||
[navbarOutside],
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppShell
|
<AppShell
|
||||||
header={{ height: 48 }}
|
header={{ height: 48 }}
|
||||||
@ -149,11 +136,7 @@ export default function ShareShell({
|
|||||||
</AppShell.Header>
|
</AppShell.Header>
|
||||||
|
|
||||||
{data?.pageTree?.length > 1 && (
|
{data?.pageTree?.length > 1 && (
|
||||||
<AppShell.Navbar
|
<AppShell.Navbar p="md" className={classes.navbar}>
|
||||||
p="md"
|
|
||||||
className={classes.navbar}
|
|
||||||
ref={setNavbarOutside}
|
|
||||||
>
|
|
||||||
<MemoizedSharedTree sharedPageTree={data} />
|
<MemoizedSharedTree sharedPageTree={data} />
|
||||||
</AppShell.Navbar>
|
</AppShell.Navbar>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user