File tree Expand file tree Collapse file tree 9 files changed +39
-50
lines changed Expand file tree Collapse file tree 9 files changed +39
-50
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import Layout from './src/components/layout'
13require ( 'prismjs/themes/prism-tomorrow.css' )
24require ( './src/main.css' )
35
4- /**
5- * Implement Gatsby's Browser APIs in this file.
6- *
7- * See: https://www.gatsbyjs.org/docs/browser-apis/
8- */
9-
10- // You can delete this file if you're not using it
6+ export const wrapPageElement = ( { element, props } ) => {
7+ return < Layout { ...props } > { element } </ Layout >
8+ }
Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import Layout from './src/components/layout'
3+
4+ export const wrapPageElement = ( { element, props } ) => {
5+ return < Layout { ...props } > { element } </ Layout >
6+ }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const Container = styled.div`
1010const FoundTypo = ( ) => {
1111 return (
1212 < Container >
13- < p > 👀 Found a typo? < a href = 'https://github.com/npm/cli/' > Let us know!</ a > </ p >
13+ < p > < span role = 'img' aria-label = 'eyes-emoji' > 👀 </ span > Found a typo? < a href = 'https://github.com/npm/cli/' > Let us know!</ a > </ p >
1414 < p > The current stable version of npm is < a href = 'https://github.com/npm/cli/' > here</ a > . To upgrade, run: < code className = 'language-text' > npm install npm@latest -g</ code > </ p >
1515 < p >
1616 To report bugs or submit feature requests for the docs, please post < a href = 'https://npm.community/c/support/docs-needed' > here</ a > .
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ const DarkBlock = () => {
3030 < Text >
3131 < p > The current stable version of npm is < a href = { 'https://github.com/npm/cli/releases/latest' } style = { aStyle } > available on GitHub.</ a > </ p >
3232 < p > To upgrade, run: < code className = { 'language-text' } style = { { color : 'white' } } > npm install npm@latest -g</ code > </ p >
33- < p > To report bugs or submit feature requests, < a href = { '#' } style = { aStyle } > please XXX.</ a > </ p >
3433 </ Text >
3534 < Box pt = { 4 } > < LinkButton to = 'cli-commands/npm' w = { '120px' } > read docs</ LinkButton > </ Box >
3635 </ ContentWrapper >
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ const Bracket = styled.span`
7878 margin-top: 10px;
7979`
8080
81- const Text = styled . strong `
81+ const Text = styled . span `
8282 font-size: 15px;
8383 font-weight: 400;
8484 letter-spacing: 1px;
Original file line number Diff line number Diff line change @@ -2,16 +2,22 @@ import React from 'react'
22import Navbar from './Navbar'
33import Sidebar from './Sidebar'
44import { 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 ( / c l i - c o m m a n d s | c o n f i g u r i n g - n p m | u s i n g - n p m / )
512
6- const Layout = ( { children, showSidebar} ) => {
713 return (
8- < React . Fragment >
14+ < ThemeProvider theme = { theme } >
915 < Navbar />
1016 < Flex w = { 1 } >
1117 { showSidebar && < Sidebar /> }
1218 < Box width = { 1 } > { children } </ Box >
1319 </ Flex >
14- </ React . Fragment >
20+ </ ThemeProvider >
1521 )
1622}
1723
Original file line number Diff line number Diff line change 11import React from 'react'
2-
3- import Layout from 'src/components/Layout'
42import SEO from 'src/components/seo'
53
6- import { ThemeProvider } from 'styled-components'
7- import { theme } from 'src/theme'
8-
94const NotFoundPage = ( ) => (
10- < ThemeProvider theme = { theme } >
11- < Layout >
12- < SEO title = '404: Not found' />
13- < h1 > NOT FOUND</ h1 >
14- < p > You just hit a route that doesn't exist... the sadness.</ p >
15- </ Layout >
16- </ ThemeProvider >
5+ < React . Fragment >
6+ < SEO title = '404: Not found' />
7+ < h1 > NOT FOUND</ h1 >
8+ < p > You just hit a route that doesn't exist... the sadness.</ p >
9+ </ React . Fragment >
1710)
1811
1912export default NotFoundPage
Original file line number Diff line number Diff line change 11import React from 'react'
2- import Layout from 'src/components/Layout'
32import Features from 'src/components/home/Features'
43import SEO from 'src/components/seo'
54import Hero from 'src/components/home/Hero'
65import DarkBlock from 'src/components/home/DarkBlock'
7- import Footer from 'src/components/home/footer'
8- import { ThemeProvider } from 'styled-components'
9- import { theme } from 'src/theme'
106
117const IndexPage = ( ) => (
12- < ThemeProvider theme = { theme } >
13- < Layout showSidebar = { false } >
14- < SEO title = 'npm cli' />
15- < Hero />
16- < Features />
17- < DarkBlock />
18- < Footer />
19- </ Layout >
20- </ ThemeProvider >
8+ < React . Fragment >
9+ < SEO title = 'npm cli' />
10+ < Hero />
11+ < Features />
12+ < DarkBlock />
13+ </ React . Fragment >
2114)
2215
2316export default IndexPage
Original file line number Diff line number Diff line change 11import React from 'react'
2- import Layout from 'src/components/Layout'
32import { graphql } from 'gatsby'
4- import styled , { ThemeProvider } from 'styled-components'
5- import { theme } from 'src/theme'
3+ import styled from 'styled-components'
64import FoundTypo from 'src/components/FoundTypo'
75import Scripts from 'src/components/Scripts'
86const version = require ( '../../../package.json' ) . version
@@ -20,15 +18,11 @@ const Page = ({data}) => {
2018 . replace ( / ( [ a - z A - Z \\ . - ] * ) ( \( ( 1 | 5 | 7 ) \) ) < \/ h 1 > / , '$1</h1>' )
2119
2220 return (
23- < ThemeProvider theme = { theme } >
24- < Layout showSidebar >
25- < Content className = 'documentation' >
26- < div dangerouslySetInnerHTML = { { __html : html } } />
27- < FoundTypo />
28- < Scripts />
29- </ Content >
30- </ Layout >
31- </ ThemeProvider >
21+ < Content className = 'documentation' >
22+ < div dangerouslySetInnerHTML = { { __html : html } } />
23+ < FoundTypo />
24+ < Scripts />
25+ </ Content >
3226 )
3327}
3428
You can’t perform that action at this time.
0 commit comments