Skip to content

Commit e38476c

Browse files
author
Brandon Johnson
committed
Upgrade Gatsby
1 parent 7ece0ec commit e38476c

File tree

7 files changed

+1121
-777
lines changed

7 files changed

+1121
-777
lines changed

components/Meetup.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ export default class Meetup extends React.Component {
2222
window
2323
.fetch(NEXT_MEETUP_URI)
2424
.then(res => res.json())
25-
.then(json =>
25+
.then(({ name, time, venue }) =>
2626
this.setState({
27-
...json,
27+
name,
28+
time,
29+
venue,
2830
loading: false,
2931
error: false
3032
})
@@ -43,9 +45,7 @@ export default class Meetup extends React.Component {
4345
title: {
4446
fontSize: '2rem',
4547
margin: '1rem'
46-
},
47-
bug: {},
48-
rsvpButton: {}
48+
}
4949
}
5050

5151
const MeetupDescription = ({ name, time, venue }) => (

html.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ import typography from './utils/typography'
77

88
const BUILD_TIME = new Date().getTime()
99

10-
module.exports = React.createClass({
11-
propTypes () {
12-
return {
13-
body: React.PropTypes.string,
14-
}
15-
},
10+
export default class Html extends React.Component {
1611
render () {
1712
const head = Helmet.rewind()
1813

@@ -42,5 +37,5 @@ module.exports = React.createClass({
4237
</body>
4338
</html>
4439
)
45-
},
46-
})
40+
}
41+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
"test": "echo \"Error: no test specified\" && exit 1"
4444
},
4545
"lint-staged": {
46-
"{pages,components,css}/**/*.{js,json,css}": ["prettier --write --no-semi --single-quote", "git add"]
46+
"{pages,components,css}/**/*.{js,json,css}": [
47+
"prettier --write --no-semi --single-quote",
48+
"git add"
49+
]
4750
}
4851
}

pages/_template.jsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@ import { config } from 'config'
1010

1111
import { rhythm } from '../utils/typography'
1212

13-
module.exports = React.createClass({
14-
propTypes () {
15-
return {
16-
children: React.PropTypes.any,
17-
}
18-
},
13+
export default class Template extends React.Component {
1914
render () {
2015
return (
2116
<div className="site-wrapper">
@@ -74,5 +69,5 @@ module.exports = React.createClass({
7469
</Container>
7570
</div>
7671
)
77-
},
78-
})
72+
}
73+
}

wrappers/html.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@ import React from 'react'
22
import Helmet from 'react-helmet'
33
import { config } from 'config'
44

5-
module.exports = React.createClass({
6-
propTypes () {
7-
return {
8-
router: React.PropTypes.object,
9-
}
10-
},
5+
export default class Html extends React.Component {
116
render () {
127
const page = this.props.route.page.data
138
return (
149
<div dangerouslySetInnerHTML={{ __html: page.body }} />
1510
)
16-
},
17-
})
11+
}
12+
}

wrappers/md.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@ import 'css/markdown-styles.css'
33
import Helmet from 'react-helmet'
44
import { config } from 'config'
55

6-
module.exports = React.createClass({
7-
propTypes () {
8-
return {
9-
router: React.PropTypes.object,
10-
}
11-
},
6+
export default class Md extends React.Component {
127
render () {
138
const post = this.props.route.page.data
149
return (
@@ -20,5 +15,5 @@ module.exports = React.createClass({
2015
<div dangerouslySetInnerHTML={{ __html: post.body }} />
2116
</div>
2217
)
23-
},
24-
})
18+
}
19+
}

0 commit comments

Comments
 (0)