Created
September 25, 2020 15:17
-
-
Save janpauldahlke/d92bbc2967ca0189bd65b174359297fc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import React from "react" | |
import { Location } from "@reach/router" | |
import styled, { ThemeProvider } from "styled-components" | |
import Favicon from '../../assets/DentaMile.ico'; | |
import Helmet from 'react-helmet'; | |
import Header from "../components/header" | |
import SideBar from "../components/sidebar" | |
import Footer from "../components/footer" | |
import LightBox from "../components/lightbox" | |
import { withTrans } from "../i18n/withTrans" | |
import { theme } from "./globalStyle" | |
/* | |
this is our main layout | |
*/ | |
const MainLayoutWrapper = styled.div` | |
user-select: none; | |
background-color: ${({ theme }) => theme.darkMode.almostBlack}; | |
color: ${(props) => (props.mode === "true" ? "white" : "black")}; | |
display: flex; | |
div { | |
flex: 1; | |
} | |
` | |
const Layout = ({ children }) => { | |
//TODO: klären, soll seiten titel gleich kapitel sein, oder nur ein globaler seitentitel? | |
return ( | |
<React.Fragment> | |
<Helmet> | |
<title>i18n title</title> | |
<link rel="icon" href={Favicon} /> | |
</Helmet> | |
<ThemeProvider theme={theme}> | |
<Location> | |
{({ location }) => { | |
return ( | |
<React.Fragment> | |
<Header /> | |
<MainLayoutWrapper> | |
<SideBar location={location} /> | |
{children} | |
</MainLayoutWrapper> | |
{/** TODO: think! we migth want to change markup here, to inlcude footer into mainlayoutwrapper */} | |
<Footer /> | |
<LightBox /> | |
</React.Fragment> | |
) | |
}} | |
</Location> | |
</ThemeProvider> | |
</React.Fragment> | |
) | |
} | |
export default withTrans(Layout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/pages/index.js