|
@@ -1,18 +1,19 @@
|
|
|
|
|
+import React from 'react';
|
|
|
|
|
+
|
|
|
import {
|
|
import {
|
|
|
IUser, IUserHasId,
|
|
IUser, IUserHasId,
|
|
|
} from '@growi/core';
|
|
} from '@growi/core';
|
|
|
-
|
|
|
|
|
-import dynamic from 'next/dynamic';
|
|
|
|
|
import { NextPage, GetServerSideProps, GetServerSidePropsContext } from 'next';
|
|
import { NextPage, GetServerSideProps, GetServerSidePropsContext } from 'next';
|
|
|
|
|
+import dynamic from 'next/dynamic';
|
|
|
|
|
|
|
|
-import GrowiContextualSubNavigation from '~/components/Navbar/GrowiContextualSubNavigation';
|
|
|
|
|
import { CrowiRequest } from '~/interfaces/crowi-request';
|
|
import { CrowiRequest } from '~/interfaces/crowi-request';
|
|
|
import { IUserUISettings } from '~/interfaces/user-ui-settings';
|
|
import { IUserUISettings } from '~/interfaces/user-ui-settings';
|
|
|
import UserUISettings from '~/server/models/user-ui-settings';
|
|
import UserUISettings from '~/server/models/user-ui-settings';
|
|
|
|
|
|
|
|
import { BasicLayout } from '../components/Layout/BasicLayout';
|
|
import { BasicLayout } from '../components/Layout/BasicLayout';
|
|
|
|
|
+import GrowiContextualSubNavigation from '../components/Navbar/GrowiContextualSubNavigation';
|
|
|
import {
|
|
import {
|
|
|
- useCurrentUser, useIsTrashPage, useCurrentPagePath, useCurrentPathname,
|
|
|
|
|
|
|
+ useCurrentUser, useCurrentPageId, useCurrentPagePath, useCurrentPathname,
|
|
|
useIsSearchServiceConfigured, useIsSearchServiceReachable,
|
|
useIsSearchServiceConfigured, useIsSearchServiceReachable,
|
|
|
useIsSearchScopeChildrenAsDefault,
|
|
useIsSearchScopeChildrenAsDefault,
|
|
|
} from '../stores/context';
|
|
} from '../stores/context';
|
|
@@ -21,6 +22,10 @@ import {
|
|
|
CommonProps, getServerSideCommonProps, useCustomTitle,
|
|
CommonProps, getServerSideCommonProps, useCustomTitle,
|
|
|
} from './utils/commons';
|
|
} from './utils/commons';
|
|
|
|
|
|
|
|
|
|
+const TrashPageList = dynamic(() => import('~/components/TrashPageList').then(mod => mod.TrashPageList), { ssr: false });
|
|
|
|
|
+const EmptyTrashModal = dynamic(() => import('~/components/EmptyTrashModal'), { ssr: false });
|
|
|
|
|
+const PutbackPageModal = dynamic(() => import('~/components/PutbackPageModal'), { ssr: false });
|
|
|
|
|
+
|
|
|
type Props = CommonProps & {
|
|
type Props = CommonProps & {
|
|
|
currentUser: IUser,
|
|
currentUser: IUser,
|
|
|
isSearchServiceConfigured: boolean,
|
|
isSearchServiceConfigured: boolean,
|
|
@@ -30,15 +35,13 @@ type Props = CommonProps & {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const TrashPage: NextPage<CommonProps> = (props: Props) => {
|
|
const TrashPage: NextPage<CommonProps> = (props: Props) => {
|
|
|
- const TrashPageList = dynamic(() => import('~/components/TrashPageList').then(mod => mod.TrashPageList), { ssr: false });
|
|
|
|
|
-
|
|
|
|
|
useCurrentUser(props.currentUser ?? null);
|
|
useCurrentUser(props.currentUser ?? null);
|
|
|
|
|
|
|
|
useIsSearchServiceConfigured(props.isSearchServiceConfigured);
|
|
useIsSearchServiceConfigured(props.isSearchServiceConfigured);
|
|
|
useIsSearchServiceReachable(props.isSearchServiceReachable);
|
|
useIsSearchServiceReachable(props.isSearchServiceReachable);
|
|
|
useIsSearchScopeChildrenAsDefault(props.isSearchScopeChildrenAsDefault);
|
|
useIsSearchScopeChildrenAsDefault(props.isSearchScopeChildrenAsDefault);
|
|
|
|
|
|
|
|
- useIsTrashPage(true);
|
|
|
|
|
|
|
+ useCurrentPageId(null);
|
|
|
useCurrentPathname('/trash');
|
|
useCurrentPathname('/trash');
|
|
|
useCurrentPagePath('/trash');
|
|
useCurrentPagePath('/trash');
|
|
|
|
|
|
|
@@ -48,10 +51,16 @@ const TrashPage: NextPage<CommonProps> = (props: Props) => {
|
|
|
<header className="py-0 position-relative">
|
|
<header className="py-0 position-relative">
|
|
|
<GrowiContextualSubNavigation isLinkSharingDisabled={false} />
|
|
<GrowiContextualSubNavigation isLinkSharingDisabled={false} />
|
|
|
</header>
|
|
</header>
|
|
|
|
|
+
|
|
|
<div className="grw-container-convertible mb-5 pb-5">
|
|
<div className="grw-container-convertible mb-5 pb-5">
|
|
|
<TrashPageList />
|
|
<TrashPageList />
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+ <div id="grw-fav-sticky-trigger" className="sticky-top"></div>
|
|
|
</BasicLayout>
|
|
</BasicLayout>
|
|
|
|
|
+
|
|
|
|
|
+ <EmptyTrashModal />
|
|
|
|
|
+ <PutbackPageModal />
|
|
|
</>
|
|
</>
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|