@@ -50,10 +50,7 @@ class Home extends Component {
50
50
51
51
return (
52
52
< div css = { { width : '100%' } } >
53
- < TitleAndMetaTags
54
- title = { title }
55
- ogUrl = { createOgUrl ( 'index.html' ) }
56
- />
53
+ < TitleAndMetaTags title = { title } ogUrl = { createOgUrl ( 'index.html' ) } />
57
54
< header
58
55
css = { {
59
56
backgroundColor : colors . dark ,
@@ -146,132 +143,151 @@ class Home extends Component {
146
143
147
144
< Container >
148
145
< div css = { [ sharedStyles . markdown , markdownStyles ] } >
149
- < section className = "home-section" css = { {
150
- [ media . lessThan ( 'medium' ) ] : {
151
- marginTop : 0 ,
152
- marginBottom : 0 ,
153
- overflowX : 'auto' ,
154
- paddingTop : 30 ,
155
- WebkitOverflowScrolling : 'touch' ,
156
- position : 'relative' ,
157
- maskImage :
158
- 'linear-gradient(to right, transparent, white 10px, white 90%, transparent)' ,
159
- } ,
160
- } } >
161
- < div css = { {
162
- display : 'flex' ,
163
- flexDirection : 'row' ,
164
-
146
+ < section
147
+ className = "home-section"
148
+ css = { {
165
149
[ media . lessThan ( 'medium' ) ] : {
166
- display : 'block' ,
167
- whiteSpace : 'nowrap' ,
150
+ marginTop : 0 ,
151
+ marginBottom : 0 ,
152
+ overflowX : 'auto' ,
153
+ paddingTop : 30 ,
154
+ WebkitOverflowScrolling : 'touch' ,
155
+ position : 'relative' ,
156
+ maskImage :
157
+ 'linear-gradient(to right, transparent, white 10px, white 90%, transparent)' ,
168
158
} ,
169
159
} } >
170
- { marketingColumns . map ( ( column , index ) =>
171
- < div key = { index } css = { {
172
- display : 'flex' ,
173
- flexDirection : 'column' ,
174
- flex : '0 1 33%' ,
175
- marginLeft : 40 ,
160
+ < div
161
+ css = { {
162
+ display : 'flex' ,
163
+ flexDirection : 'row' ,
176
164
177
- '&:first-of-type' : {
178
- marginLeft : 0 ,
165
+ [ media . lessThan ( 'medium' ) ] : {
166
+ display : 'block' ,
167
+ whiteSpace : 'nowrap' ,
168
+ } ,
169
+ } } >
170
+ { marketingColumns . map ( ( column , index ) => (
171
+ < div
172
+ key = { index }
173
+ css = { {
174
+ display : 'flex' ,
175
+ flexDirection : 'column' ,
176
+ flex : '0 1 33%' ,
177
+ marginLeft : 40 ,
179
178
180
- [ media . lessThan ( 'medium' ) ] : {
181
- marginLeft : 10 ,
179
+ '&:first-of-type' : {
180
+ marginLeft : 0 ,
181
+
182
+ [ media . lessThan ( 'medium' ) ] : {
183
+ marginLeft : 10 ,
184
+ } ,
182
185
} ,
183
- } ,
184
186
185
- [ media . lessThan ( 'medium' ) ] : {
186
- display : 'inline-block' ,
187
- verticalAlign : 'top' ,
188
- marginLeft : 0 ,
189
- whiteSpace : 'normal' ,
190
- width : '75%' ,
191
- marginRight : 20 ,
192
- paddingBottom : 40 ,
187
+ [ media . lessThan ( 'medium' ) ] : {
188
+ display : 'inline-block' ,
189
+ verticalAlign : 'top' ,
190
+ marginLeft : 0 ,
191
+ whiteSpace : 'normal' ,
192
+ width : '75%' ,
193
+ marginRight : 20 ,
194
+ paddingBottom : 40 ,
195
+
196
+ '&:first-of-type' : {
197
+ marginTop : 0 ,
198
+ } ,
199
+ } ,
193
200
194
- '&:first-of-type ' : {
195
- marginTop : 0 ,
201
+ '& p ' : {
202
+ lineHeight : 1.7 ,
196
203
} ,
197
- } ,
198
-
199
- '& p' : {
200
- lineHeight : 1.7 ,
201
- } ,
202
- } } >
203
- < h3 css = { {
204
- '&&' : { // Make specificity higher than the site-wide h3 styles.
205
- color : colors . subtle ,
206
- marginBottom : 20 ,
207
- paddingTop : 0 ,
208
- fontWeight : 300 ,
209
- fontSize : 20 ,
210
-
211
- [ media . greaterThan ( 'xlarge' ) ] : {
212
- fontSize : 24 ,
213
- fontWeight : 200 ,
204
+ } } >
205
+ < h3
206
+ css = { {
207
+ '&&' : {
208
+ // Make specificity higher than the site-wide h3 styles.
209
+ color : colors . subtle ,
210
+ marginBottom : 20 ,
211
+ paddingTop : 0 ,
212
+ fontWeight : 300 ,
213
+ fontSize : 20 ,
214
+
215
+ [ media . greaterThan ( 'xlarge' ) ] : {
216
+ fontSize : 24 ,
217
+ fontWeight : 200 ,
218
+ } ,
214
219
} ,
215
- } ,
216
- } } > { column . title } </ h3 >
220
+ } } >
221
+ { column . title }
222
+ </ h3 >
217
223
< div dangerouslySetInnerHTML = { { __html : column . content } } />
218
224
</ div >
219
- ) }
225
+ ) ) }
220
226
</ div >
221
227
</ section >
222
- < hr css = { {
223
- height : 1 ,
224
- marginBottom : - 1 ,
225
- border : 'none' ,
226
- borderBottom : `1 solid ${ colors . divider } ` ,
227
- } } />
228
+ < hr
229
+ css = { {
230
+ height : 1 ,
231
+ marginBottom : - 1 ,
232
+ border : 'none' ,
233
+ borderBottom : `1 solid ${ colors . divider } ` ,
234
+ } }
235
+ />
228
236
< section className = "home-section" >
229
237
< div id = "examples" >
230
238
< div className = "example" >
231
239
< h3 > A Simple Component</ h3 >
232
240
< p >
233
- React components implement a `render()` method that takes input data and
234
- returns what to display. This example uses an XML-like syntax called
235
- JSX. Input data that is passed into the component can be accessed by
236
- `render()` via `this.props`.
241
+ React components implement a `render()` method that takes
242
+ input data and returns what to display. This example uses an
243
+ XML-like syntax called JSX. Input data that is passed into
244
+ the component can be accessed by `render()` via
245
+ `this.props`.
237
246
</ p >
238
247
< p >
239
- < strong > JSX is optional and not required to use React.</ strong >
240
- Try the
241
- < a href = "http://babeljs.io/repl#?babili=false& browsers = & build = & builtIns = false & code_lz = MYGwhgzhAEASCmIQHsCy8pgOb2vAHgC7wB2AJjAErxjCEB0AwsgLYAOyJph0A3gFABIAE6ky8YQAoAlHyEj4hAK7CS0ADxkAlgDcAfAiTI - hABZaI9NsORtLJMC3gBfdQHpt-gNxDn_P_zUtIQAIgDyqPSi5BKS6oYo6Jg40A5OALwARCHwOlokmdBuegA00CzISiSEAHLI4tJeQA & debug = false & circleciRepo = & evaluate = false & lineWrap = false & presets = react & prettier = true & targets = & version = 6.26 .0 ">Babel REPL</a>
242
- to see the raw JavaScript code produced by the JSX compilation step.
248
+ < strong >
249
+ JSX is optional and not required to use React.
250
+ </ strong > { ' ' }
251
+ Try the{ ' ' }
252
+ < a href = "http://babeljs.io/repl#?babili=false& browsers = & build = & builtIns = false & code_lz = MYGwhgzhAEASCmIQHsCy8pgOb2vAHgC7wB2AJjAErxjCEB0AwsgLYAOyJph0A3gFABIAE6ky8YQAoAlHyEj4hAK7CS0ADxkAlgDcAfAiTI - hABZaI9NsORtLJMC3gBfdQHpt-gNxDn_P_zUtIQAIgDyqPSi5BKS6oYo6Jg40A5OALwARCHwOlokmdBuegA00CzISiSEAHLI4tJeQA & debug = false & circleciRepo = & evaluate = false & lineWrap = false & presets = react & prettier = true & targets = & version = 6.26 .0 ">
253
+ Babel REPL
254
+ </a>{' '}
255
+ to see the raw JavaScript code produced by the JSX
256
+ compilation step.
243
257
</p>
244
- <div id=" helloExample "> </ div >
258
+ <div id=" helloExample " / >
245
259
</ div >
246
260
< div className = "example" >
247
261
< h3 > A Stateful Component</ h3 >
248
262
< p >
249
- In addition to taking input data (accessed via `this.props`), a
250
- component can maintain internal state data (accessed via `this.state`).
251
- When a component's state data changes, the rendered markup will be
252
- updated by re-invoking `render()`.
263
+ In addition to taking input data (accessed via
264
+ `this.props`), a component can maintain internal state data
265
+ (accessed via `this.state`). When a component's state data
266
+ changes, the rendered markup will be updated by re-invoking
267
+ `render()`.
253
268
</ p >
254
- < div id = "timerExample" > </ div >
269
+ < div id = "timerExample" / >
255
270
</ div >
256
271
< div className = "example" >
257
272
< h3 > An Application</ h3 >
258
273
< p >
259
- Using `props` and `state`, we can put together a small Todo application.
260
- This example uses `state` to track the current list of items as well as
261
- the text that the user has entered. Although event handlers appear to be
262
- rendered inline, they will be collected and implemented using event
263
- delegation.
274
+ Using `props` and `state`, we can put together a small Todo
275
+ application. This example uses `state` to track the current
276
+ list of items as well as the text that the user has entered.
277
+ Although event handlers appear to be rendered inline, they
278
+ will be collected and implemented using event delegation.
264
279
</ p >
265
- < div id = "todoExample" > </ div >
280
+ < div id = "todoExample" / >
266
281
</ div >
267
282
< div className = "example" >
268
283
< h3 > A Component Using External Plugins</ h3 >
269
284
< p >
270
- React is flexible and provides hooks that allow you to interface with
271
- other libraries and frameworks. This example uses < strong > remarkable</ strong > , an
272
- external Markdown library, to convert the textarea's value in real time.
285
+ React is flexible and provides hooks that allow you to
286
+ interface with other libraries and frameworks. This example
287
+ uses < strong > remarkable</ strong > , an external Markdown
288
+ library, to convert the textarea's value in real time.
273
289
</ p >
274
- < div id = "markdownExample" > </ div >
290
+ < div id = "markdownExample" / >
275
291
</ div >
276
292
</ div >
277
293
</ section >
@@ -350,22 +366,21 @@ const CtaItem = ({children, primary = false}) => (
350
366
351
367
// eslint-disable-next-line no-undef
352
368
export const pageQuery = graphql`
353
- query MarketingMarkdown {
354
- allMarkdownRemark (
355
- filter : { id : { regex : "/marketing/" } } ,
356
- sort : { fields : [ frontmatter___order ] ,
357
- order : ASC }
358
- ) {
359
- edges {
360
- node {
361
- frontmatter {
362
- title
369
+ query MarketingMarkdown {
370
+ allMarkdownRemark (
371
+ filter : { id : { regex : "/marketing/" } }
372
+ sort : { fields : [ frontmatter___order ] , order : ASC }
373
+ ) {
374
+ edges {
375
+ node {
376
+ frontmatter {
377
+ title
378
+ }
379
+ html
363
380
}
364
- html
365
381
}
366
382
}
367
383
}
368
- }
369
384
`;
370
385
371
386
export default Home;
0 commit comments