summaryrefslogtreecommitdiff
path: root/deps/npm/docs/src/components/layout.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/docs/src/components/layout.js')
-rw-r--r--deps/npm/docs/src/components/layout.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/deps/npm/docs/src/components/layout.js b/deps/npm/docs/src/components/layout.js
new file mode 100644
index 0000000000..ebb2636bfc
--- /dev/null
+++ b/deps/npm/docs/src/components/layout.js
@@ -0,0 +1,24 @@
+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