|
@@ -7,7 +7,6 @@ import dynamic from 'next/dynamic';
|
|
|
import Head from 'next/head';
|
|
import Head from 'next/head';
|
|
|
import { Container, Provider } from 'unstated';
|
|
import { Container, Provider } from 'unstated';
|
|
|
|
|
|
|
|
-
|
|
|
|
|
import AdminAppContainer from '~/client/services/AdminAppContainer';
|
|
import AdminAppContainer from '~/client/services/AdminAppContainer';
|
|
|
import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
|
|
import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
|
|
|
import { useCurrentUser } from '~/stores/context';
|
|
import { useCurrentUser } from '~/stores/context';
|
|
@@ -18,6 +17,7 @@ import { retrieveServerSideProps } from '../../utils/admin-page-util';
|
|
|
|
|
|
|
|
const AdminLayout = dynamic(() => import('~/components/Layout/AdminLayout'), { ssr: false });
|
|
const AdminLayout = dynamic(() => import('~/components/Layout/AdminLayout'), { ssr: false });
|
|
|
const AppSettingsPageContents = dynamic(() => import('~/components/Admin/App/AppSettingsPageContents'), { ssr: false });
|
|
const AppSettingsPageContents = dynamic(() => import('~/components/Admin/App/AppSettingsPageContents'), { ssr: false });
|
|
|
|
|
+const ForbiddenPage = dynamic(() => import('~/components/Admin/ForbiddenPage').then(mod => mod.ForbiddenPage), { ssr: false });
|
|
|
|
|
|
|
|
|
|
|
|
|
const AdminAppPage: NextPage<CommonProps> = (props) => {
|
|
const AdminAppPage: NextPage<CommonProps> = (props) => {
|
|
@@ -34,6 +34,10 @@ const AdminAppPage: NextPage<CommonProps> = (props) => {
|
|
|
|
|
|
|
|
const title = generateCustomTitle(props, t('headers.app_settings'));
|
|
const title = generateCustomTitle(props, t('headers.app_settings'));
|
|
|
|
|
|
|
|
|
|
+ if (props.isAccessDeniedForNonAdminUser) {
|
|
|
|
|
+ return <ForbiddenPage />;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<Provider inject={[...injectableContainers]}>
|
|
<Provider inject={[...injectableContainers]}>
|
|
|
<AdminLayout componentTitle={title}>
|
|
<AdminLayout componentTitle={title}>
|