You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
604 B
JavaScript
25 lines
604 B
JavaScript
|
6 years ago
|
import React from 'react'
|
||
|
|
import Navbar from './navbar'
|
||
|
|
import Sidebar from './Sidebar'
|
||
|
|
import {Flex, Box} from 'rebass'
|
||
|
|
import { theme } from 'src/theme'
|
||
|
|
import { ThemeProvider } from 'styled-components'
|
||
|
|
|
||
|
|
const IS_STATIC = process.env.GATSBY_IS_STATIC
|
||
|
|
|
||
|
|
const Layout = ({children, path}) => {
|
||
|
|
const showSidebar = IS_STATIC || path.match(/cli-commands|configuring-npm|using-npm/)
|
||
|
|
|
||
|
|
return (
|
||
|
|
<ThemeProvider theme={theme}>
|
||
|
|
<Navbar />
|
||
|
|
<Flex w={1}>
|
||
|
|
{showSidebar && <Sidebar />}
|
||
|
|
<Box width={1}>{children}</Box>
|
||
|
|
</Flex>
|
||
|
|
</ThemeProvider>
|
||
|
|
)
|
||
|
|
}
|
||
|
|
|
||
|
|
export default Layout
|