Skip to content

Commit afcde75

Browse files
authored
feat: add marketo form (#1138)
1 parent f54207c commit afcde75

18 files changed

+488
-2
lines changed

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ GATSBY_ALGOLIA_APP_ID=
77
GATSBY_ALGOLIA_SEARCH_ONLY_KEY=
88
GATSBY_ALGOLIA_INDEX_NAME=
99
ALGOLIA_ADMIN_KEY=
10+
11+
GATSBY_NEWSLETTER_FORM_MUNCHKIN_ID=
12+
GATSBY_NEWSLETTER_FORM_ID=
13+
GATSBY_NEWSLETTER_FORM_URL=

.github/workflows/pr-deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ env:
66
GATSBY_DEFAULT_DOC_URL: https://mdr-ci.staging.k6.io/docs/${{ github.ref }}
77
GATSBY_DEFAULT_BLOG_URL: https://k6.io/blog
88
GATSBY_DEFAULT_APP_URL: https://app.staging.k6.io
9+
GATSBY_NEWSLETTER_FORM_URL: https://go2.grafana.com
10+
GATSBY_NEWSLETTER_FORM_MUNCHKIN_ID: 356-YFG-389
11+
GATSBY_NEWSLETTER_FORM_ID: 1420
912

1013
on:
1114
pull_request:

.github/workflows/production.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ env:
2121
GATSBY_DEFAULT_DOC_URL: https://${{ secrets.PROD_CI_MAIN_URL }}/docs
2222
GATSBY_DEFAULT_MAIN_URL: https://${{ secrets.PROD_CI_MAIN_URL }}
2323
GATSBY_GOOGLE_API_KEY: ${{ secrets.PROD_CI_GATSBY_GOOGLE_API_KEY }}
24+
GATSBY_NEWSLETTER_FORM_URL: https://go2.grafana.com
25+
GATSBY_NEWSLETTER_FORM_MUNCHKIN_ID: 356-YFG-389
26+
GATSBY_NEWSLETTER_FORM_ID: 1420
2427

2528
jobs:
2629
update-dependencies:

.github/workflows/staging.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ env:
2121
GATSBY_DEFAULT_DOC_URL: https://staging.k6.io/docs
2222
GATSBY_DEFAULT_MAIN_URL: https://staging.k6.io
2323
GATSBY_GOOGLE_API_KEY: ${{ secrets.STAGING_CI_GATSBY_GOOGLE_API_KEY }}
24+
GATSBY_NEWSLETTER_FORM_URL: https://go2.grafana.com
25+
GATSBY_NEWSLETTER_FORM_MUNCHKIN_ID: 356-YFG-389
26+
GATSBY_NEWSLETTER_FORM_ID: 1420
27+
2428
jobs:
2529
update-dependencies:
2630
name: Update node module dependencies

package-lock.json

Lines changed: 109 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"prepare": "husky install"
3333
},
3434
"dependencies": {
35+
"@hookform/resolvers": "^3.1.0",
3536
"@mdx-js/mdx": "^1.6.22",
3637
"@mdx-js/react": "^1.6.22",
3738
"@sentry/gatsby": "^7.21.1",
@@ -70,10 +71,12 @@
7071
"react-clipboard.js": "^2.0.16",
7172
"react-cookie-banner": "^4.1.0",
7273
"react-dom": "^17.0.2",
74+
"react-hook-form": "^7.43.9",
7375
"react-instantsearch-dom": "^6.38.1",
7476
"react-tooltip": "^4.5.1",
7577
"runes": "^0.4.3",
76-
"sass": "^1.56.1"
78+
"sass": "^1.56.1",
79+
"yup": "^1.1.1"
7780
},
7881
"devDependencies": {
7982
"@babel/core": "^7.20.2",

src/components/blocks/footer/footer.view.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import SubscribeForm from 'components/shared/subscribe-form';
12
import { Link } from 'gatsby';
23
import React, { useState, useEffect } from 'react';
34
import Logo from 'svg/logo-with-grafana-labs.inline.svg';
@@ -318,6 +319,8 @@ export const Footer = () => {
318319
</div>
319320
</div>
320321

322+
<SubscribeForm />
323+
321324
<div className={'container'}>
322325
<div className={'row'}>
323326
<div className={'col-md-2 col-sm-12 col-auto'}>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.wrapper {
2+
text-align: center;
3+
width: 100%;
4+
}
5+
6+
.success-icon {
7+
margin-bottom: 10px;
8+
svg {
9+
display: block;
10+
margin: 0 auto;
11+
}
12+
}
13+
14+
.success-text {
15+
font-size: $font-size-sm;
16+
}
17+
18+
.error-text {
19+
font-size: $font-size-sm;
20+
color: $color-error;
21+
22+
a {
23+
color: $color-error;
24+
font-weight: bold;
25+
text-decoration: none;
26+
27+
@include hover-supported {
28+
text-decoration: underline;
29+
}
30+
}
31+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import MarketoForm from 'components/shared/marketo-form';
2+
import PropTypes from 'prop-types';
3+
import React from 'react';
4+
5+
import styles from './form-message.module.scss';
6+
import SuccessSVG from './svg/success.inline.svg';
7+
8+
const FormMessage = ({ type }) => (
9+
<div className={styles.wrapper}>
10+
{type === 'success' && (
11+
<>
12+
<div className={styles.successIcon}>
13+
<SuccessSVG />
14+
</div>
15+
<span className={styles.successText}>
16+
Your message has been successfully sent
17+
</span>
18+
</>
19+
)}
20+
{type === 'error' && (
21+
<span className={styles.errorText}>
22+
Your message has not been sent. Please, if the problem persists, contact{' '}
23+
<a href={'mailto:[email protected]'}>[email protected]</a>.
24+
</span>
25+
)}
26+
</div>
27+
);
28+
29+
MarketoForm.propTypes = {
30+
type: PropTypes.string.isRequired,
31+
};
32+
33+
export default FormMessage;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import FormMessage from './form-message.view';
2+
3+
export default FormMessage;

0 commit comments

Comments
 (0)