Skip to content

Commit 137f0ff

Browse files
committed
Minor formatting fixes
1 parent a1cb7af commit 137f0ff

File tree

2 files changed

+120
-106
lines changed

2 files changed

+120
-106
lines changed

gatsby-node.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ exports.createPages = async ({graphql, boundActionCreators}) => {
3232
const communityTemplate = resolve('./src/templates/community.js');
3333
const docsTemplate = resolve('./src/templates/docs.js');
3434
const tutorialTemplate = resolve('./src/templates/tutorial.js');
35-
const homeTemplate = resolve('./src/templates/home.js');
3635

3736
const allMarkdown = await graphql(
3837
`

src/pages/index.js

Lines changed: 120 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ class Home extends Component {
5050

5151
return (
5252
<div css={{width: '100%'}}>
53-
<TitleAndMetaTags
54-
title={title}
55-
ogUrl={createOgUrl('index.html')}
56-
/>
53+
<TitleAndMetaTags title={title} ogUrl={createOgUrl('index.html')} />
5754
<header
5855
css={{
5956
backgroundColor: colors.dark,
@@ -146,132 +143,151 @@ class Home extends Component {
146143

147144
<Container>
148145
<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={{
165149
[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)',
168158
},
169159
}}>
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',
176164

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,
179178

180-
[media.lessThan('medium')]: {
181-
marginLeft: 10,
179+
'&:first-of-type': {
180+
marginLeft: 0,
181+
182+
[media.lessThan('medium')]: {
183+
marginLeft: 10,
184+
},
182185
},
183-
},
184186

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+
},
193200

194-
'&:first-of-type': {
195-
marginTop: 0,
201+
'& p': {
202+
lineHeight: 1.7,
196203
},
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+
},
214219
},
215-
},
216-
}}>{column.title}</h3>
220+
}}>
221+
{column.title}
222+
</h3>
217223
<div dangerouslySetInnerHTML={{__html: column.content}} />
218224
</div>
219-
)}
225+
))}
220226
</div>
221227
</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+
/>
228236
<section className="home-section">
229237
<div id="examples">
230238
<div className="example">
231239
<h3>A Simple Component</h3>
232240
<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`.
237246
</p>
238247
<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.
243257
</p>
244-
<div id="helloExample"></div>
258+
<div id="helloExample" />
245259
</div>
246260
<div className="example">
247261
<h3>A Stateful Component</h3>
248262
<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()`.
253268
</p>
254-
<div id="timerExample"></div>
269+
<div id="timerExample" />
255270
</div>
256271
<div className="example">
257272
<h3>An Application</h3>
258273
<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.
264279
</p>
265-
<div id="todoExample"></div>
280+
<div id="todoExample" />
266281
</div>
267282
<div className="example">
268283
<h3>A Component Using External Plugins</h3>
269284
<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.
273289
</p>
274-
<div id="markdownExample"></div>
290+
<div id="markdownExample" />
275291
</div>
276292
</div>
277293
</section>
@@ -350,22 +366,21 @@ const CtaItem = ({children, primary = false}) => (
350366

351367
// eslint-disable-next-line no-undef
352368
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
363380
}
364-
html
365381
}
366382
}
367383
}
368-
}
369384
`;
370385
371386
export default Home;

0 commit comments

Comments
 (0)