|
|
@@ -6,7 +6,7 @@ import dynamic from 'next/dynamic';
|
|
|
|
|
|
// import { smoothScrollIntoView } from '~/client/util/smooth-scroll';
|
|
|
import {
|
|
|
- useCurrentPagePath, useIsSharedUser, useIsEditable, useIsUserPage, usePageUser, useShareLinkId, useIsNotFound,
|
|
|
+ useCurrentPagePath, useIsSharedUser, useIsEditable, useIsUserPage, useShareLinkId, useIsNotFound,
|
|
|
} from '~/stores/context';
|
|
|
import { useDescendantsPageListModal } from '~/stores/modal';
|
|
|
import { useSWRxCurrentPage } from '~/stores/page';
|
|
|
@@ -17,8 +17,6 @@ import CustomTabContent from '../CustomNavigation/CustomTabContent';
|
|
|
import PageListIcon from '../Icons/PageListIcon';
|
|
|
import { Page } from '../Page';
|
|
|
import TableOfContents from '../TableOfContents';
|
|
|
-import { UserInfoProps } from '../User/UserInfo';
|
|
|
-
|
|
|
|
|
|
import styles from './DisplaySwitcher.module.scss';
|
|
|
|
|
|
@@ -30,9 +28,9 @@ const PageEditor = dynamic(() => import('../PageEditor'), { ssr: false });
|
|
|
const PageEditorByHackmd = dynamic(() => import('../PageEditorByHackmd').then(mod => mod.PageEditorByHackmd), { ssr: false });
|
|
|
const EditorNavbarBottom = dynamic(() => import('../PageEditor/EditorNavbarBottom'), { ssr: false });
|
|
|
const HashChanged = dynamic(() => import('../EventListeneres/HashChanged'), { ssr: false });
|
|
|
-const ContentLinkButtons = dynamic(() => import('../ContentLinkButtons'), { ssr: false });
|
|
|
+const ContentLinkButtons = dynamic(() => import('../ContentLinkButtons').then(mod => mod.ContentLinkButtons), { ssr: false });
|
|
|
const NotFoundPage = dynamic(() => import('../NotFoundPage'), { ssr: false });
|
|
|
-const UserInfo = dynamic<UserInfoProps>(() => import('../User/UserInfo').then(mod => mod.UserInfo), { ssr: false });
|
|
|
+const UserInfo = dynamic(() => import('../User/UserInfo').then(mod => mod.UserInfo), { ssr: false });
|
|
|
|
|
|
|
|
|
const PageView = React.memo((): JSX.Element => {
|
|
|
@@ -42,7 +40,6 @@ const PageView = React.memo((): JSX.Element => {
|
|
|
const { data: isSharedUser } = useIsSharedUser();
|
|
|
const { data: shareLinkId } = useShareLinkId();
|
|
|
const { data: isUserPage } = useIsUserPage();
|
|
|
- const { data: pageUser } = usePageUser();
|
|
|
const { data: isNotFound } = useIsNotFound();
|
|
|
const { data: currentPage } = useSWRxCurrentPage(shareLinkId ?? undefined);
|
|
|
const { open: openDescendantPageListModal } = useDescendantsPageListModal();
|
|
|
@@ -53,7 +50,7 @@ const PageView = React.memo((): JSX.Element => {
|
|
|
<div className="d-flex flex-column flex-lg-row">
|
|
|
|
|
|
<div className="flex-grow-1 flex-basis-0 mw-0">
|
|
|
- { isUserPage && pageUser != null && <UserInfo pageUser={pageUser} />}
|
|
|
+ { isUserPage && <UserInfo /> }
|
|
|
{ !isNotFound && <Page /> }
|
|
|
{ isNotFound && <NotFoundPage /> }
|
|
|
</div>
|
|
|
@@ -98,7 +95,7 @@ const PageView = React.memo((): JSX.Element => {
|
|
|
|
|
|
<div className="d-none d-lg-block">
|
|
|
<TableOfContents />
|
|
|
- <ContentLinkButtons />
|
|
|
+ { isUserPage && <ContentLinkButtons /> }
|
|
|
</div>
|
|
|
|
|
|
</div>
|