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

Commit 3898542

Browse files
author
dpatanin
committed
add mailchimp plugin and unstyled contact page
1 parent 2cea130 commit 3898542

5 files changed

Lines changed: 247 additions & 40 deletions

File tree

gatsby-config.js

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -43,32 +43,32 @@ module.exports = {
4343
siteMetadata: {
4444
title: `secureCodeBox`,
4545
company: `iteratec GmbH`,
46-
description: '',
46+
description: "",
4747
// siteUrl: '',
4848
contact: {
49-
phone: 'XXX XXX XXX',
50-
email: 'security@iteratec.de',
49+
phone: "XXX XXX XXX",
50+
email: "security@iteratec.de"
5151
},
5252
// TODO: replace links with actual pages here and link the correct reference in Menu.js
5353
menuLinks: [
5454
{
55-
name: 'Get Started',
55+
name: "Get Started",
5656
external: true,
5757
// link: '/getStarted',
58-
link: 'https://github.com/secureCodeBox/secureCodeBox',
58+
link: "https://github.com/secureCodeBox/secureCodeBox"
5959
},
6060
{
61-
name: 'Docs',
61+
name: "Docs",
6262
external: true,
6363
// link: '/docs',
64-
link: 'https://github.com/secureCodeBox/secureCodeBox/tree/master/docs',
64+
link: "https://github.com/secureCodeBox/secureCodeBox/tree/master/docs"
6565
},
6666
{
67-
name: 'Scanner',
67+
name: "Scanner",
6868
external: false,
69-
link: '/scanner',
70-
},
71-
],
69+
link: "/scanner"
70+
}
71+
]
7272
},
7373

7474
plugins: [
@@ -79,10 +79,10 @@ module.exports = {
7979
options: {
8080
tableOfContents: {
8181
heading: null,
82-
maxDepth: 6,
82+
maxDepth: 6
8383
},
84-
excerpt_separator: `<!-- end -->`,
85-
},
84+
excerpt_separator: `<!-- end -->`
85+
}
8686
},
8787
{
8888
resolve: `gatsby-plugin-manifest`,
@@ -95,38 +95,45 @@ module.exports = {
9595
// Enables "Add to Homescreen" prompt and disables browser UI (including back button)
9696
// see https://developers.google.com/web/fundamentals/web-app-manifest/#display
9797
display: `standalone`,
98-
icon: `src/images/icon.png`, // This path is relative to the root of the site.
99-
},
98+
icon: `src/images/icon.png` // This path is relative to the root of the site.
99+
}
100100
},
101101
`gatsby-plugin-offline`, //should be listed *after* gatsby-plugin-manifest
102102
`gatsby-plugin-react-helmet`,
103103
{
104104
resolve: `gatsby-source-filesystem`,
105105
options: {
106-
name: 'src',
107-
path: `${__dirname}/src/`,
108-
},
106+
name: "src",
107+
path: `${__dirname}/src/`
108+
}
109109
},
110110
{
111-
resolve: 'gatsby-source-filesystem',
111+
resolve: "gatsby-source-filesystem",
112112
options: {
113113
path: `${__dirname}/src/pages`,
114-
name: 'pages',
115-
},
114+
name: "pages"
115+
}
116116
},
117117
{
118-
resolve: 'gatsby-source-filesystem',
118+
resolve: "gatsby-source-filesystem",
119119
options: {
120120
path: `${__dirname}/src/data`,
121-
name: 'data',
122-
},
121+
name: "data"
122+
}
123123
},
124124
{
125-
resolve: 'gatsby-source-filesystem',
125+
resolve: "gatsby-source-filesystem",
126126
options: {
127127
path: `${__dirname}/src/images`,
128-
name: 'images',
129-
},
128+
name: "images"
129+
}
130+
},
131+
{
132+
resolve: "gatsby-plugin-mailchimp",
133+
options: {
134+
endpoint:
135+
"https://securecodebox.us16.list-manage.com/subscribe/post?u=3aeba03d53798fc931e449d46&amp;id=252edbca74"
136+
}
130137
},
131138

132139
...scannerRepos.map(({ name, url }) => {
@@ -136,9 +143,9 @@ module.exports = {
136143
name: name,
137144
remote: url,
138145
branch: `update-doc`,
139-
patterns: `README.md`,
140-
},
146+
patterns: `README.md`
147+
}
141148
};
142-
}),
143-
],
149+
})
150+
]
144151
};

package-lock.json

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@emotion/core": "^10.0.14",
1717
"gatsby": "^2.13.39",
1818
"gatsby-plugin-emotion": "^4.1.2",
19+
"gatsby-plugin-mailchimp": "^5.1.2",
1920
"gatsby-plugin-manifest": "^2.2.4",
2021
"gatsby-plugin-offline": "^2.2.4",
2122
"gatsby-plugin-react-helmet": "^3.1.2",

src/pages/contact/index.js

Lines changed: 167 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,171 @@
11
import React from "react";
2-
import Layout from '../../components/Layout';
3-
import SEO from '../../components/SEO';
2+
import Layout from "../../components/Layout";
3+
import SEO from "../../components/SEO";
4+
import addToMailchimp from "gatsby-plugin-mailchimp";
45

6+
class ContactPage extends React.Component {
7+
state = {
8+
name: null,
9+
email: null
10+
};
511

6-
export default () => (
7-
<Layout bodyclass="page-contact">
12+
_handleChange = e => {
13+
console.log({
14+
[`${e.target.name}`]: e.target.value
15+
});
16+
this.setState({
17+
[`${e.target.name}`]: e.target.value
18+
});
19+
};
20+
21+
_handleSubmit = e => {
22+
e.preventDefault();
23+
24+
console.log("submit", this.state);
25+
26+
addToMailchimp(this.state.email, this.state)
27+
.then(({ msg, result }) => {
28+
console.log("msg", `${result}: ${msg}`);
29+
30+
if (result !== "success") {
31+
throw msg;
32+
}
33+
alert(msg);
34+
})
35+
.catch(err => {
36+
console.log("err", err);
37+
alert(err);
38+
});
39+
};
40+
41+
render() {
42+
return (
43+
<Layout bodyclass="page-contact">
844
<SEO title="Contact" />
9-
<p>Send us a message!</p>
10-
<a href="https://github.com/secureCodeBox">SecureCodeBox Github</a>
11-
</Layout>
12-
)
45+
<div clas="container">
46+
<div class="row m-b-lg">
47+
<div class="col-lg-12 text-center">
48+
<div class="navy-line"></div>
49+
<h1>Contact us now!</h1>
50+
<p></p>
51+
</div>
52+
</div>
53+
<div class="row m-b-lg">
54+
<div class="col-lg-3 col-lg-offset-3">
55+
<address>
56+
<strong>
57+
<span class="navy">iteratec GmbH</span>
58+
</strong>
59+
<br />
60+
St.-Martin-Straße 114
61+
<br />
62+
81669 München
63+
<br />
64+
Telefon: +49 89 614551-0
65+
</address>
66+
</div>
67+
<div class="col-lg-4">
68+
<p class="text-color">
69+
You're interested about{" "}
70+
<a href="https://github.com/secureCodeBox">secureCodeBox</a> or
71+
security in generell? Subscribe our newsletter and get in touch
72+
with us. We'll keep you up to date.
73+
</p>
74+
<p class="text-color">
75+
You want hands on? Checkout our{" "}
76+
<a href="https://github.com/secureCodeBox/secureCodeBox">
77+
Git repository
78+
</a>{" "}
79+
and spin up your own <em>secureCodeBox</em> with{" "}
80+
<a href="https://docs.docker.com/compose/">Docker Compose</a>.
81+
</p>
82+
</div>
83+
</div>
84+
85+
<div class="row">
86+
<div class="col-lg-12 text-center">
87+
<div id="mc_embed_signup">
88+
<form onSubmit={this._handleSubmit}>
89+
<div class="form-group">
90+
<label for="mce-EMAIL" class="col-lg-4 control-label">
91+
Email address<span class="asterisk">*</span>
92+
</label>
93+
<div class="col-lg-8">
94+
<input
95+
type="email"
96+
onChange={this._handleChange}
97+
placeholder="email"
98+
name="email"
99+
id="mce-EMAIL"
100+
/>
101+
</div>
102+
</div>
103+
<div class="form-group">
104+
<label for="mce-FNAME" class="col-lg-4 control-label">
105+
First name<span class="asterisk">*</span>
106+
</label>
107+
<div class="col-lg-8">
108+
<input
109+
type="text"
110+
onChange={this._handleChange}
111+
placeholder="first name"
112+
name="fname"
113+
id="mce-FNAME"
114+
/>
115+
</div>
116+
</div>
117+
<div class="form-group">
118+
<label for="mce-LNAME" class="col-lg-4 control-label">
119+
Surname<span class="asterisk">*</span>
120+
</label>
121+
<div class="col-lg-8">
122+
<input
123+
type="text"
124+
onChange={this._handleChange}
125+
placeholder="surname"
126+
name="lname"
127+
id="mce-LNAME"
128+
/>
129+
</div>
130+
</div>
131+
132+
<div class="form-group">
133+
<label for="mce-MESSAGE" class="col-lg-4 control-label">
134+
Interessted in &hellip;
135+
</label>
136+
<div class="col-lg-8">
137+
<input
138+
type="text"
139+
onChange={this._handleChange}
140+
placeholder="Write your message!"
141+
name="message"
142+
id="mce-MESSAGE"
143+
/>
144+
</div>
145+
</div>
146+
<div id="mce-responses" class="clear">
147+
<div class="response" id="mce-error-response"></div>
148+
<div class="response" id="mce-success-response"></div>
149+
</div>
150+
<p class="m-t-sm">* required fields</p>
151+
152+
<div class="clear">
153+
<input
154+
type="submit"
155+
value="Subscribe"
156+
name="subscribe"
157+
id="mc-embedded-subscribe"
158+
class="btn btn-primary"
159+
/>
160+
</div>
161+
</form>
162+
</div>
163+
</div>
164+
</div>
165+
</div>
166+
</Layout>
167+
);
168+
}
169+
}
170+
171+
export default ContactPage;

src/scss/components/_buttons.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@
2323
text-decoration: none;
2424
}
2525
}
26+
27+
28+

0 commit comments

Comments
 (0)