Created
December 20, 2016 21:20
-
-
Save ctrldavid/5dd93920763f8ac81ae6f7c92033bc45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Router (doesn't include any info about headers): | |
<Router history={history}> | |
<Route path="/" component={App}> | |
<IndexRoute component={LandingPageContainer} /> | |
<Route path="home" component={LandingPageContainer} /> | |
<Route path="authentication" component={Authentication} /> | |
// ... others | |
</Route> | |
</Router> | |
// App (Doesn't interact with children at all) | |
export default function App({ children, location: { pathname } }) { | |
// This is the current 'hack', I'd like to just read in something from props that is passed down by the router | |
const hideHeader = pathname === '/' || pathname === '/home'; | |
return <div className={css.app}> | |
<HeaderContainer overlay={hideHeader} /> | |
{children} | |
<FooterContainer /> | |
</div>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment