mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-07-28 14:51:16 -07:00
Refactor layout (#486)
* Refactor to move `<DatasetContainer>` out of layout * `<DatasetContainer>` is now in the methodology page. Starting the review there will help understand the motive for this change. * Fixed 404 page which seems way out of date. * Use row/col grid syntax
This commit is contained in:
parent
9a9d5fdf7f
commit
73a205dc48
7 changed files with 285 additions and 216 deletions
|
@ -1,10 +1,7 @@
|
|||
import React, {ReactNode} from 'react';
|
||||
import {GridContainer, Grid} from '@trussworks/react-uswds';
|
||||
import J40Header from './J40Header';
|
||||
import J40Footer from './J40Footer';
|
||||
import {URLFlagProvider} from '../contexts/FlagContext';
|
||||
import DatasetContainer from '../components/DatasetContainer';
|
||||
// this has to be wrong
|
||||
|
||||
interface ILayoutProps {
|
||||
children: ReactNode,
|
||||
|
@ -12,22 +9,13 @@ interface ILayoutProps {
|
|||
}
|
||||
|
||||
const Layout = ({children, location}: ILayoutProps) => {
|
||||
const isMethodologyPage = location.pathname.match(/methodology\/?/);
|
||||
|
||||
// @ts-ignore
|
||||
return (
|
||||
<URLFlagProvider location={location}>
|
||||
<J40Header location={location}/>
|
||||
<GridContainer containerSize={'desktop-lg'}
|
||||
className={'j40-grid-container'}>
|
||||
<Grid row>
|
||||
<main id={'main-content'}
|
||||
className={'usa-layout-docs j40-main-content desktop:grid-col-12'}>
|
||||
{children}
|
||||
</main>
|
||||
</Grid>
|
||||
</GridContainer>
|
||||
{isMethodologyPage ? <DatasetContainer />: null}
|
||||
<main id={'main-content'}>
|
||||
{children}
|
||||
</main>
|
||||
<J40Footer/>
|
||||
</URLFlagProvider>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue