File tree 9 files changed +39
-50
lines changed
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'
1
3
require ( 'prismjs/themes/prism-tomorrow.css' )
2
4
require ( './src/main.css' )
3
5
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`
10
10
const FoundTypo = ( ) => {
11
11
return (
12
12
< 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 >
14
14
< 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 >
15
15
< p >
16
16
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 = () => {
30
30
< Text >
31
31
< p > The current stable version of npm is < a href = { 'https://github.com/npm/cli/releases/latest' } style = { aStyle } > available on GitHub.</ a > </ p >
32
32
< 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 >
34
33
</ Text >
35
34
< Box pt = { 4 } > < LinkButton to = 'cli-commands/npm' w = { '120px' } > read docs</ LinkButton > </ Box >
36
35
</ ContentWrapper >
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ const Bracket = styled.span`
78
78
margin-top: 10px;
79
79
`
80
80
81
- const Text = styled . strong `
81
+ const Text = styled . span `
82
82
font-size: 15px;
83
83
font-weight: 400;
84
84
letter-spacing: 1px;
Original file line number Diff line number Diff line change @@ -2,16 +2,22 @@ import React from 'react'
2
2
import Navbar from './Navbar'
3
3
import Sidebar from './Sidebar'
4
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 ( / 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 / )
5
12
6
- const Layout = ( { children, showSidebar} ) => {
7
13
return (
8
- < React . Fragment >
14
+ < ThemeProvider theme = { theme } >
9
15
< Navbar />
10
16
< Flex w = { 1 } >
11
17
{ showSidebar && < Sidebar /> }
12
18
< Box width = { 1 } > { children } </ Box >
13
19
</ Flex >
14
- </ React . Fragment >
20
+ </ ThemeProvider >
15
21
)
16
22
}
17
23
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
-
3
- import Layout from 'src/components/Layout'
4
2
import SEO from 'src/components/seo'
5
3
6
- import { ThemeProvider } from 'styled-components'
7
- import { theme } from 'src/theme'
8
-
9
4
const 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 >
17
10
)
18
11
19
12
export default NotFoundPage
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
- import Layout from 'src/components/Layout'
3
2
import Features from 'src/components/home/Features'
4
3
import SEO from 'src/components/seo'
5
4
import Hero from 'src/components/home/Hero'
6
5
import 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'
10
6
11
7
const 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 >
21
14
)
22
15
23
16
export default IndexPage
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
- import Layout from 'src/components/Layout'
3
2
import { graphql } from 'gatsby'
4
- import styled , { ThemeProvider } from 'styled-components'
5
- import { theme } from 'src/theme'
3
+ import styled from 'styled-components'
6
4
import FoundTypo from 'src/components/FoundTypo'
7
5
import Scripts from 'src/components/Scripts'
8
6
const version = require ( '../../../package.json' ) . version
@@ -20,15 +18,11 @@ const Page = ({data}) => {
20
18
. replace ( / ( [ a - z A - Z \\ . - ] * ) ( \( ( 1 | 5 | 7 ) \) ) < \/ h 1 > / , '$1</h1>' )
21
19
22
20
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 >
32
26
)
33
27
}
34
28
You can’t perform that action at this time.
0 commit comments