1 | import React from 'react'
|
2 | import Navbar from './navbar'
|
3 | import Sidebar from './Sidebar'
|
4 | import {Flex, Box} from 'rebass'
|
5 | import { theme } from 'src/theme'
|
6 | import { ThemeProvider } from 'styled-components'
|
7 |
|
8 | const IS_STATIC = process.env.GATSBY_IS_STATIC
|
9 |
|
10 | const Layout = ({children, path}) => {
|
11 | const showSidebar = IS_STATIC || path.match(/cli-commands|configuring-npm|using-npm/)
|
12 |
|
13 | return (
|
14 | <ThemeProvider theme={theme}>
|
15 | <Navbar />
|
16 | <Flex w={1}>
|
17 | {showSidebar && <Sidebar />}
|
18 | <Box width={1}>{children}</Box>
|
19 | </Flex>
|
20 | </ThemeProvider>
|
21 | )
|
22 | }
|
23 |
|
24 | export default Layout
|