Make each admin page specify is own layout. Closes #2584

This commit is contained in:
Gabe Kangas
2023-01-15 23:11:44 -08:00
parent 3b232f31e1
commit 2853752937
24 changed files with 167 additions and 37 deletions

View File

@@ -1,5 +1,5 @@
/* eslint-disable @next/next/no-css-tags */
import React, { useState, useEffect, useContext } from 'react';
import React, { useState, useEffect, useContext, ReactElement } from 'react';
import { Skeleton, Card, Statistic, Row, Col } from 'antd';
import { formatDistanceToNow, formatRelative } from 'date-fns';
import dynamic from 'next/dynamic';
@@ -12,6 +12,8 @@ import { LOGS_WARN, fetchData, FETCH_INTERVAL } from '../../utils/apis';
import { formatIPAddress, isEmptyObject } from '../../utils/format';
import { NewsFeed } from '../../components/admin/NewsFeed';
import { AdminLayout } from '../../components/layouts/AdminLayout';
// Lazy loaded components
const UserOutlined = dynamic(() => import('@ant-design/icons/UserOutlined'), {
@@ -189,3 +191,7 @@ export default function Home() {
</div>
);
}
Home.getLayout = function getLayout(page: ReactElement) {
return <AdminLayout page={page} />;
};