|
1 | 1 | import React from 'react'; |
2 | | -import { graphql, withPrefix } from 'gatsby'; |
| 2 | +import { withPrefix } from 'gatsby'; |
3 | 3 | import Helmet from 'react-helmet'; |
4 | 4 | import SEO from '../components/SEO'; |
5 | 5 | import Layout from '../components/Layout'; |
6 | 6 | import approved from '../images/approved.svg'; |
7 | 7 | import notApproved from '../images/not approved.svg'; |
8 | 8 |
|
9 | | -const Home = props => { |
10 | | - const json = props.data.allFeaturesJson.edges; |
| 9 | +import features from '../data/features.json'; |
| 10 | + |
| 11 | +const Home = () => { |
11 | 12 | return ( |
12 | 13 | <Layout bodyClass="page-home"> |
13 | 14 | <SEO title="Home" /> |
@@ -37,15 +38,15 @@ const Home = props => { |
37 | 38 | What the secureCodeBox provides: |
38 | 39 | </h2> |
39 | 40 | </div> |
40 | | - {json.map(edge => ( |
41 | | - <div key={edge.node.id} className="col-12 col-md-3 col-lg-3 mb-2"> |
| 41 | + {features.map(feature => ( |
| 42 | + <div key={feature.id} className="col-12 col-md-3 col-lg-3 mb-2"> |
42 | 43 | <div className="feature hoverable"> |
43 | | - {edge.node.image && ( |
| 44 | + {feature.image && ( |
44 | 45 | <div className="feature-image"> |
45 | | - <img src={withPrefix(edge.node.image)} /> |
| 46 | + <img src={withPrefix(feature.image)} /> |
46 | 47 | </div> |
47 | 48 | )} |
48 | | - <h2 className="feature-title">{edge.node.title}</h2> |
| 49 | + <h2 className="feature-title">{feature.title}</h2> |
49 | 50 | {/* TODO add link to corresponding pages */} |
50 | 51 | </div> |
51 | 52 | </div> |
@@ -94,19 +95,4 @@ const Home = props => { |
94 | 95 | ); |
95 | 96 | }; |
96 | 97 |
|
97 | | -export const query = graphql` |
98 | | - query { |
99 | | - allFeaturesJson(filter: { tag: { eq: "provision" } }) { |
100 | | - edges { |
101 | | - node { |
102 | | - id |
103 | | - title |
104 | | - image |
105 | | - tag |
106 | | - } |
107 | | - } |
108 | | - } |
109 | | - } |
110 | | -`; |
111 | | - |
112 | 98 | export default Home; |
0 commit comments