Skip to content

Commit 0ecd3e3

Browse files
committed
exclude external footer from layout
1 parent 2f14215 commit 0ecd3e3

File tree

5 files changed

+38
-25
lines changed

5 files changed

+38
-25
lines changed

src/lib/Layouts.tsx

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React from 'react';
2+
import HealHeader from './HealNav/HealHeader';
3+
import HealFooter from './HealNav/HealFooter';
4+
5+
export default function Layout({
6+
children,
7+
}: {
8+
children: React.ReactNode
9+
}) {
10+
return (
11+
<>
12+
<HealHeader />
13+
<main id="main-content" className="flex-grow">
14+
{children}
15+
</main>
16+
<HealFooter />
17+
</>
18+
);
19+
}

src/pages/_document.tsx

-22
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
import Document, {
22
DocumentContext,
33
DocumentInitialProps,
4-
Html,
5-
Head,
6-
Main,
7-
NextScript,
84
} from 'next/document';
95
import { ColorSchemeScript } from '@mantine/core';
10-
import HealHeader from '@/lib/HealNav/HealHeader';
11-
import HealFooter from '@/lib/HealNav/HealFooter';
126

137
class Gen3Document extends Document {
148
static async getInitialProps(
@@ -25,22 +19,6 @@ class Gen3Document extends Document {
2519
),
2620
};
2721
}
28-
29-
render() {
30-
return (
31-
<Html lang="en">
32-
<Head />
33-
<body className="flex flex-col min-h-screen">
34-
<HealHeader />
35-
<main id="main-content" className="flex-grow">
36-
<Main />
37-
<NextScript />
38-
</main>
39-
<HealFooter />
40-
</body>
41-
</Html>
42-
);
43-
}
4422
}
4523

4624
export default Gen3Document;

src/pages/external/footer.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { GetServerSideProps } from 'next';
12
import React from 'react';
23
import HealFooter from '@/lib/HealNav/HealFooter';
34

@@ -9,4 +10,10 @@ const StandaloneFooterPage = () => {
910
);
1011
};
1112

13+
export const getServerSideProps: GetServerSideProps = async () => {
14+
return {
15+
props: {},
16+
};
17+
};
18+
1219
export default StandaloneFooterPage;

src/pages/index.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
import Layout from '@/lib/Layouts';
12
import HealLandingPage from './Home';
2-
export default HealLandingPage;
3+
4+
export default function IndexPage() {
5+
return (
6+
<Layout>
7+
<HealLandingPage />
8+
</Layout>
9+
);
10+
}

src/pages/newly-available-datasets.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@ import React from 'react';
22
import CardedPageContent from '@/lib/NewlyAvailableDatasets/CardedPageContent';
33
import newDatasetsPageConfig from '../../config/heal/newDatasets.json';
44
import PageTitle from '@/lib/HealNav/PageTitle';
5+
import Layout from '@/lib/Layouts';
56

67
const NewlyAvailableDatasetsPage = () => {
78
return (
8-
<>
9+
<Layout>
910
<PageTitle pageName="Newly Available Datasets" />
1011
<div className="flex flex-row justify-items-center">
1112
<div className="sm:prose-base lg:prose-lg xl:prose-xl 2xl:prose-xl mx-20">
1213
<CardedPageContent {...newDatasetsPageConfig} />
1314
</div>
1415
</div>
15-
</>
16+
</Layout>
1617
);
1718
};
1819

0 commit comments

Comments
 (0)