Skip to content

Commit 19db4e6

Browse files
authored
Merge pull request #214 from ZoltanVeres/yarn-formatting
Reformatting code using prettier
2 parents 819120f + d377b69 commit 19db4e6

File tree

6 files changed

+186
-174
lines changed

6 files changed

+186
-174
lines changed

gatsby-config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ module.exports = {
6868
},
6969
},
7070
{
71-
resolve:'gatsby-plugin-purgecss', // purges all unused/unreferenced css rules
71+
resolve: 'gatsby-plugin-purgecss', // purges all unused/unreferenced css rules
7272
options: {
73-
develop: true, // Activates purging in npm run develop
73+
develop: true, // Activates purging in npm run develop
7474
purgeOnly: ['/all.sass'], // applies purging only on the bulma css file
7575
},
7676
}, // must be after other CSS plugins

src/cms/preview-templates/IndexPagePreview.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ const IndexPagePreview = ({ entry, getAsset }) => {
1111
image={entry.getIn(['data', 'image'])}
1212
title={entry.getIn(['data', 'title'])}
1313
heading={entry.getIn(['data', 'heading'])}
14-
subheading = {entry.getIn(['data', 'subheading'])}
14+
subheading={entry.getIn(['data', 'subheading'])}
1515
description={entry.getIn(['data', 'description'])}
1616
intro={{ blurbs }}
1717
main={{
1818
heading: entry.getIn(['data', 'main', 'heading']),
1919
description: entry.getIn(['data', 'main', 'description']),
2020
mainpitch: {
21-
title: entry.getIn(['data','mainpitch', 'title']),
22-
description: entry.getIn(['data','mainpitch', 'description'])
21+
title: entry.getIn(['data', 'mainpitch', 'title']),
22+
description: entry.getIn(['data', 'mainpitch', 'description']),
2323
},
2424
image1: {
2525
image: getAsset(entry.getIn(['data', 'main', 'image1', 'image'])),

src/components/BlogRoll.js

+46-47
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,41 @@ import PropTypes from 'prop-types'
33
import { Link, graphql, StaticQuery } from 'gatsby'
44

55
class BlogRoll extends React.Component {
6-
76
render() {
87
const { data } = this.props
98
const { edges: posts } = data.allMarkdownRemark
10-
9+
1110
return (
1211
<div className="columns is-multiline">
13-
{posts && (posts
14-
.map(({ node: post }) => (
15-
<div
16-
className="is-parent column is-6"
17-
key={post.id}
18-
>
19-
<article className="tile is-child box notification">
20-
<p>
21-
<Link className="title has-text-primary is-size-4" to={post.fields.slug}>
22-
{post.frontmatter.title}
23-
</Link>
24-
<span> &bull; </span>
25-
<span className="subtitle is-size-5 is-block">{post.frontmatter.date}</span>
26-
</p>
27-
<p>
28-
{post.excerpt}
29-
<br />
30-
<br />
31-
<Link className="button" to={post.fields.slug}>
32-
Keep Reading →
33-
</Link>
34-
</p>
12+
{posts &&
13+
posts.map(({ node: post }) => (
14+
<div className="is-parent column is-6" key={post.id}>
15+
<article className="tile is-child box notification">
16+
<p>
17+
<Link
18+
className="title has-text-primary is-size-4"
19+
to={post.fields.slug}
20+
>
21+
{post.frontmatter.title}
22+
</Link>
23+
<span> &bull; </span>
24+
<span className="subtitle is-size-5 is-block">
25+
{post.frontmatter.date}
26+
</span>
27+
</p>
28+
<p>
29+
{post.excerpt}
30+
<br />
31+
<br />
32+
<Link className="button" to={post.fields.slug}>
33+
Keep Reading →
34+
</Link>
35+
</p>
3536
</article>
3637
</div>
37-
)))}
38-
</div>
39-
);
38+
))}
39+
</div>
40+
)
4041
}
4142
}
4243

@@ -51,30 +52,28 @@ BlogRoll.propTypes = {
5152
export default () => (
5253
<StaticQuery
5354
query={graphql`
54-
query BlogRollQuery {
55-
allMarkdownRemark(
56-
sort: { order: DESC, fields: [frontmatter___date] },
57-
filter: { frontmatter: { templateKey: { eq: "blog-post" } }}
58-
) {
59-
edges {
60-
node {
61-
excerpt(pruneLength: 400)
62-
id
63-
fields {
64-
slug
65-
}
66-
frontmatter {
67-
title
68-
templateKey
69-
date(formatString: "MMMM DD, YYYY")
55+
query BlogRollQuery {
56+
allMarkdownRemark(
57+
sort: { order: DESC, fields: [frontmatter___date] }
58+
filter: { frontmatter: { templateKey: { eq: "blog-post" } } }
59+
) {
60+
edges {
61+
node {
62+
excerpt(pruneLength: 400)
63+
id
64+
fields {
65+
slug
66+
}
67+
frontmatter {
68+
title
69+
templateKey
70+
date(formatString: "MMMM DD, YYYY")
71+
}
7072
}
7173
}
7274
}
7375
}
74-
}
7576
`}
76-
render={(data, count) => (
77-
<BlogRoll data={data} count={count} />
78-
)}
77+
render={(data, count) => <BlogRoll data={data} count={count} />}
7978
/>
8079
)

src/components/Footer.js

+59-49
Original file line numberDiff line numberDiff line change
@@ -20,58 +20,68 @@ const Footer = class extends React.Component {
2020
</div>
2121
<div className="content has-text-centered has-background-black has-text-white-ter">
2222
<div className="container has-background-black has-text-white-ter">
23-
<div className="columns">
24-
<div className="column is-4">
23+
<div className="columns">
24+
<div className="column is-4">
2525
<section className="menu">
26-
<ul className="menu-list">
27-
<li><Link to="/" className="navbar-item">Home</Link></li>
28-
<li><Link className="navbar-item" to="/about">About</Link></li>
29-
<li><Link className="navbar-item" to="/products">
26+
<ul className="menu-list">
27+
<li>
28+
<Link to="/" className="navbar-item">
29+
Home
30+
</Link>
31+
</li>
32+
<li>
33+
<Link className="navbar-item" to="/about">
34+
About
35+
</Link>
36+
</li>
37+
<li>
38+
<Link className="navbar-item" to="/products">
3039
Products
3140
</Link>
3241
</li>
3342
<li>
34-
<Link className="navbar-item" to="/contact/examples">
35-
Form Examples
36-
</Link>
43+
<Link className="navbar-item" to="/contact/examples">
44+
Form Examples
45+
</Link>
46+
</li>
47+
<li>
48+
<a
49+
className="navbar-item"
50+
href="/admin/"
51+
target="_blank"
52+
rel="noopener noreferrer"
53+
>
54+
Admin
55+
</a>
3756
</li>
38-
<li><a
39-
className="navbar-item"
40-
href="/admin/"
41-
target="_blank"
42-
rel="noopener noreferrer"
43-
>
44-
Admin
45-
</a></li>
46-
</ul>
47-
</section>
48-
</div>
49-
<div className="column is-4">
57+
</ul>
58+
</section>
59+
</div>
60+
<div className="column is-4">
5061
<section>
5162
<ul className="menu-list">
52-
<li>
53-
<Link className="navbar-item" to="/blog">
54-
Latest Stories
55-
</Link>
56-
</li>
57-
<li>
58-
<Link className="navbar-item" to="/contact">
59-
Contact
60-
</Link>
61-
</li>
63+
<li>
64+
<Link className="navbar-item" to="/blog">
65+
Latest Stories
66+
</Link>
67+
</li>
68+
<li>
69+
<Link className="navbar-item" to="/contact">
70+
Contact
71+
</Link>
72+
</li>
6273
</ul>
6374
</section>
64-
</div>
65-
<div className="column is-4 social">
66-
67-
<a title="facebook" href="https://facebook.com">
68-
<img
69-
src={facebook}
70-
alt="Facebook"
71-
style={{ width: '1em', height: '1em' }}
72-
/>
73-
</a>
74-
<a title="twitter" href="https://twitter.com">
75+
</div>
76+
<div className="column is-4 social">
77+
<a title="facebook" href="https://facebook.com">
78+
<img
79+
src={facebook}
80+
alt="Facebook"
81+
style={{ width: '1em', height: '1em' }}
82+
/>
83+
</a>
84+
<a title="twitter" href="https://twitter.com">
7585
<img
7686
className="fas fa-lg"
7787
src={twitter}
@@ -81,21 +91,21 @@ const Footer = class extends React.Component {
8191
</a>
8292
<a title="instagram" href="https://instagram.com">
8393
<img
84-
src={instagram}
85-
alt="Instagram"
86-
style={{ width: '1em', height: '1em' }}
94+
src={instagram}
95+
alt="Instagram"
96+
style={{ width: '1em', height: '1em' }}
8797
/>
8898
</a>
8999
<a title="vimeo" href="https://vimeo.com">
90100
<img
91-
src={vimeo}
92-
alt="Vimeo"
93-
style={{ width: '1em', height: '1em' }}
101+
src={vimeo}
102+
alt="Vimeo"
103+
style={{ width: '1em', height: '1em' }}
94104
/>
95105
</a>
96-
</div>
97106
</div>
98107
</div>
108+
</div>
99109
</div>
100110
</footer>
101111
)

src/pages/blog/index.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ import BlogRoll from '../../components/BlogRoll'
55

66
export default class BlogIndexPage extends React.Component {
77
render() {
8-
9-
return (
8+
return (
109
<Layout>
1110
<section className="section">
1211
<div className="container">
1312
<div className="content">
14-
<div
13+
<div
1514
className="full-width-image-container margin-top-0"
1615
style={{
1716
backgroundImage: `url('/img/blog-index.jpg')`,
@@ -30,8 +29,8 @@ export default class BlogIndexPage extends React.Component {
3029
</h1>
3130
</div>
3231
</div>
33-
<BlogRoll />
34-
</div>
32+
<BlogRoll />
33+
</div>
3534
</section>
3635
</Layout>
3736
)

0 commit comments

Comments
 (0)