Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit eaa3c20

Browse files
committed
Remove gatsby-plugin-json
1 parent 1b85d72 commit eaa3c20

6 files changed

Lines changed: 39 additions & 70 deletions

File tree

package-lock.json

Lines changed: 1 addition & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"gatsby-plugin-sass": "^2.1.8",
2323
"gatsby-source-filesystem": "^2.1.7",
2424
"gatsby-source-git": "github:stevetweeddale/gatsby-source-git",
25-
"gatsby-transformer-json": "^2.2.2",
2625
"gatsby-transformer-remark": "^2.6.10",
2726
"react": "^16.8.6",
2827
"react-dom": "^16.8.6",

src/components/Menu.js

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
import React from 'react';
22
import { graphql, StaticQuery, Link } from 'gatsby';
3-
import { node } from 'prop-types';
43

5-
const Menu = (props) => {
4+
import socialChannels from '../data/social.json';
5+
6+
const Menu = props => {
67
const { menuLinks } = props.data.site.siteMetadata;
7-
const json = props.data.allFeaturesJson.edges;
88
return (
99
<div id="main-menu" className="main-menu">
1010
<ul>
1111
{menuLinks.map(link => (
1212
<li key={link.name}>
1313
{/* <Link to={link.link}>{link.name}</Link> */}
14-
<a href={link.link}>{link.name}</a>
14+
<a href={link.link}>{link.name}</a>
1515
</li>
1616
))}
17-
{json.map(edge =>(
18-
<li key={edge.node.title}>
19-
<a href={edge.node.link} target="_blank"><img src={edge.node.image} /></a>
17+
{socialChannels.map(socialChannel => (
18+
<li key={socialChannel.title}>
19+
<a href={socialChannel.link} target="_blank">
20+
<img src={socialChannel.image} />
21+
</a>
2022
</li>
2123
))}
2224
</ul>
@@ -36,17 +38,6 @@ export default props => (
3638
}
3739
}
3840
}
39-
allFeaturesJson (filter: {tag: {eq: "social"}}){
40-
edges {
41-
node {
42-
id
43-
title
44-
link
45-
image
46-
tag
47-
}
48-
}
49-
}
5041
}
5142
`}
5243
render={data => <Menu data={data} />}

src/data/features.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,5 @@
2222
"description": "Our Scans can dig deeply into your Network",
2323
"image": "/features/firewall.svg",
2424
"tag": "provision"
25-
},
26-
{
27-
"title": "Github",
28-
"image": "/features/GitHub-Mark.svg",
29-
"link": "https://github.com/secureCodeBox",
30-
"tag": "social"
31-
},
32-
{
33-
"title": "Twitter",
34-
"image": "/features/Twitter_Social_Icon_Circle_White.svg",
35-
"link": "https://twitter.com/securecodebox",
36-
"tag": "social"
37-
},
38-
{
39-
"title": "Slack",
40-
"image": "/features/Slack_Mark_Monochrome_White.svg",
41-
"link": "https://join.slack.com/t/securecodebox/shared_invite/enQtNDU3MTUyOTM0NTMwLTJiNzg3MmU2ZDY2NDFiMGI0Y2FkM2I5Mzc2ZmEzYTcyN2FlN2Y2NDFiZDE5NjAxMjg1M2IxNDViNzE3OTIxMGU",
42-
"tag": "social"
4325
}
4426
]

src/data/social.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"title": "Github",
4+
"image": "/features/GitHub-Mark.svg",
5+
"link": "https://github.com/secureCodeBox",
6+
"tag": "social"
7+
},
8+
{
9+
"title": "Twitter",
10+
"image": "/features/Twitter_Social_Icon_Circle_White.svg",
11+
"link": "https://twitter.com/securecodebox",
12+
"tag": "social"
13+
},
14+
{
15+
"title": "Slack",
16+
"image": "/features/Slack_Mark_Monochrome_White.svg",
17+
"link": "https://join.slack.com/t/securecodebox/shared_invite/enQtNDU3MTUyOTM0NTMwLTJiNzg3MmU2ZDY2NDFiMGI0Y2FkM2I5Mzc2ZmEzYTcyN2FlN2Y2NDFiZDE5NjAxMjg1M2IxNDViNzE3OTIxMGU",
18+
"tag": "social"
19+
}
20+
]

src/pages/index.js

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import React from 'react';
2-
import { graphql, withPrefix } from 'gatsby';
2+
import { withPrefix } from 'gatsby';
33
import Helmet from 'react-helmet';
44
import SEO from '../components/SEO';
55
import Layout from '../components/Layout';
66
import approved from '../images/approved.svg';
77
import notApproved from '../images/not approved.svg';
88

9-
const Home = props => {
10-
const json = props.data.allFeaturesJson.edges;
9+
import features from '../data/features.json';
10+
11+
const Home = () => {
1112
return (
1213
<Layout bodyClass="page-home">
1314
<SEO title="Home" />
@@ -37,15 +38,15 @@ const Home = props => {
3738
What the secureCodeBox provides:
3839
</h2>
3940
</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">
4243
<div className="feature hoverable">
43-
{edge.node.image && (
44+
{feature.image && (
4445
<div className="feature-image">
45-
<img src={withPrefix(edge.node.image)} />
46+
<img src={withPrefix(feature.image)} />
4647
</div>
4748
)}
48-
<h2 className="feature-title">{edge.node.title}</h2>
49+
<h2 className="feature-title">{feature.title}</h2>
4950
{/* TODO add link to corresponding pages */}
5051
</div>
5152
</div>
@@ -94,19 +95,4 @@ const Home = props => {
9495
);
9596
};
9697

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-
11298
export default Home;

0 commit comments

Comments
 (0)