|
|
@@ -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, usePageUser, useShareLinkId, useIsNotFound,
|
|
|
} from '~/stores/context';
|
|
|
import { useDescendantsPageListModal } from '~/stores/modal';
|
|
|
import { useSWRxCurrentPage } from '~/stores/page';
|
|
|
@@ -23,7 +23,7 @@ import { UserInfoProps } from '../User/UserInfo';
|
|
|
import styles from './DisplaySwitcher.module.scss';
|
|
|
|
|
|
|
|
|
-const { isTopPage } = pagePathUtils;
|
|
|
+const { isTopPage, isUsersTopPage } = pagePathUtils;
|
|
|
|
|
|
|
|
|
const PageEditor = dynamic(() => import('../PageEditor'), { ssr: false });
|
|
|
@@ -41,19 +41,19 @@ const PageView = React.memo((): JSX.Element => {
|
|
|
const { data: currentPagePath } = useCurrentPagePath();
|
|
|
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();
|
|
|
|
|
|
const isTopPagePath = isTopPage(currentPagePath ?? '');
|
|
|
+ const isUsersTopPagePath = isUsersTopPage(currentPagePath ?? '');
|
|
|
|
|
|
return (
|
|
|
<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} />}
|
|
|
+ { pageUser != null && isUsersTopPagePath && <UserInfo pageUser={pageUser} />}
|
|
|
{ !isNotFound && <Page /> }
|
|
|
{ isNotFound && <NotFoundPage /> }
|
|
|
</div>
|