|
|
@@ -77,6 +77,11 @@ const IdenticalPathPage = (): JSX.Element => {
|
|
|
return <IdenticalPathPage />;
|
|
|
};
|
|
|
|
|
|
+const PutbackPageModal = (): JSX.Element => {
|
|
|
+ const PutbackPageModal = dynamic(() => import('../components/PutbackPageModal'), { ssr: false });
|
|
|
+ return <PutbackPageModal />;
|
|
|
+};
|
|
|
+
|
|
|
type IPageToShowRevisionWithMeta = IDataWithMeta<IPagePopulatedToShowRevision, IPageInfoForEntity>;
|
|
|
|
|
|
type Props = CommonProps & {
|
|
|
@@ -194,6 +199,12 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
|
|
|
if (props.pageWithMetaStr != null) {
|
|
|
pageWithMeta = JSON.parse(props.pageWithMetaStr) as IPageToShowRevisionWithMeta;
|
|
|
}
|
|
|
+
|
|
|
+ let shouldRenderPutbackPageModal = false;
|
|
|
+ if (pageWithMeta != null) {
|
|
|
+ shouldRenderPutbackPageModal = _isTrashPage(pageWithMeta.data.path);
|
|
|
+ }
|
|
|
+
|
|
|
useCurrentPageId(pageWithMeta?.data._id);
|
|
|
useSWRxCurrentPage(undefined, pageWithMeta?.data); // store initial data
|
|
|
// useSWRxPage(pageWithMeta?.data._id);
|
|
|
@@ -285,6 +296,7 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
|
|
|
</footer>
|
|
|
|
|
|
<UnsavedAlertDialog />
|
|
|
+ {shouldRenderPutbackPageModal && <PutbackPageModal />}
|
|
|
|
|
|
</BasicLayout>
|
|
|
</>
|