Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ GATSBY_ALGOLIA_APP_ID=
GATSBY_ALGOLIA_SEARCH_ONLY_KEY=
GATSBY_ALGOLIA_INDEX_NAME=
ALGOLIA_ADMIN_KEY=

GATSBY_NEWSLETTER_FORM_MUNCHKIN_ID=
GATSBY_NEWSLETTER_FORM_ID=
GATSBY_NEWSLETTER_FORM_URL=
3 changes: 3 additions & 0 deletions .github/workflows/pr-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ env:
GATSBY_DEFAULT_DOC_URL: https://mdr-ci.staging.k6.io/docs/${{ github.ref }}
GATSBY_DEFAULT_BLOG_URL: https://k6.io/blog
GATSBY_DEFAULT_APP_URL: https://app.staging.k6.io
GATSBY_NEWSLETTER_FORM_URL: https://go2.grafana.com
GATSBY_NEWSLETTER_FORM_MUNCHKIN_ID: 356-YFG-389
GATSBY_NEWSLETTER_FORM_ID: 1420

on:
pull_request:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ env:
GATSBY_DEFAULT_DOC_URL: https://${{ secrets.PROD_CI_MAIN_URL }}/docs
GATSBY_DEFAULT_MAIN_URL: https://${{ secrets.PROD_CI_MAIN_URL }}
GATSBY_GOOGLE_API_KEY: ${{ secrets.PROD_CI_GATSBY_GOOGLE_API_KEY }}
GATSBY_NEWSLETTER_FORM_URL: https://go2.grafana.com
GATSBY_NEWSLETTER_FORM_MUNCHKIN_ID: 356-YFG-389
GATSBY_NEWSLETTER_FORM_ID: 1420

jobs:
update-dependencies:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ env:
GATSBY_DEFAULT_DOC_URL: https://staging.k6.io/docs
GATSBY_DEFAULT_MAIN_URL: https://staging.k6.io
GATSBY_GOOGLE_API_KEY: ${{ secrets.STAGING_CI_GATSBY_GOOGLE_API_KEY }}
GATSBY_NEWSLETTER_FORM_URL: https://go2.grafana.com
GATSBY_NEWSLETTER_FORM_MUNCHKIN_ID: 356-YFG-389
GATSBY_NEWSLETTER_FORM_ID: 1420

jobs:
update-dependencies:
name: Update node module dependencies
Expand Down
110 changes: 109 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"prepare": "husky install"
},
"dependencies": {
"@hookform/resolvers": "^3.1.0",
"@mdx-js/mdx": "^1.6.22",
"@mdx-js/react": "^1.6.22",
"@sentry/gatsby": "^7.21.1",
Expand Down Expand Up @@ -70,10 +71,12 @@
"react-clipboard.js": "^2.0.16",
"react-cookie-banner": "^4.1.0",
"react-dom": "^17.0.2",
"react-hook-form": "^7.43.9",
"react-instantsearch-dom": "^6.38.1",
"react-tooltip": "^4.5.1",
"runes": "^0.4.3",
"sass": "^1.56.1"
"sass": "^1.56.1",
"yup": "^1.1.1"
},
"devDependencies": {
"@babel/core": "^7.20.2",
Expand Down
3 changes: 3 additions & 0 deletions src/components/blocks/footer/footer.view.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import SubscribeForm from 'components/shared/subscribe-form';
import { Link } from 'gatsby';
import React, { useState, useEffect } from 'react';
import Logo from 'svg/logo-with-grafana-labs.inline.svg';
Expand Down Expand Up @@ -318,6 +319,8 @@ export const Footer = () => {
</div>
</div>

<SubscribeForm />

<div className={'container'}>
<div className={'row'}>
<div className={'col-md-2 col-sm-12 col-auto'}>
Expand Down
31 changes: 31 additions & 0 deletions src/components/shared/form-message/form-message.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.wrapper {
text-align: center;
width: 100%;
}

.success-icon {
margin-bottom: 10px;
svg {
display: block;
margin: 0 auto;
}
}

.success-text {
font-size: $font-size-sm;
}

.error-text {
font-size: $font-size-sm;
color: $color-error;

a {
color: $color-error;
font-weight: bold;
text-decoration: none;

@include hover-supported {
text-decoration: underline;
}
}
}
33 changes: 33 additions & 0 deletions src/components/shared/form-message/form-message.view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import MarketoForm from 'components/shared/marketo-form';
import PropTypes from 'prop-types';
import React from 'react';

import styles from './form-message.module.scss';
import SuccessSVG from './svg/success.inline.svg';

const FormMessage = ({ type }) => (
<div className={styles.wrapper}>
{type === 'success' && (
<>
<div className={styles.successIcon}>
<SuccessSVG />
</div>
<span className={styles.successText}>
Your message has been successfully sent
</span>
</>
)}
{type === 'error' && (
<span className={styles.errorText}>
Your message has not been sent. Please, if the problem persists, contact{' '}
<a href={'mailto:support@k6.io'}>support@k6.io</a>.
</span>
)}
</div>
);

MarketoForm.propTypes = {
type: PropTypes.string.isRequired,
};

export default FormMessage;
3 changes: 3 additions & 0 deletions src/components/shared/form-message/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import FormMessage from './form-message.view';

export default FormMessage;
4 changes: 4 additions & 0 deletions src/components/shared/form-message/svg/success.inline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/components/shared/marketo-form/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import MarketoForm from './marketo-form.view';

export default MarketoForm;
23 changes: 23 additions & 0 deletions src/components/shared/marketo-form/marketo-form.view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import useMarketo from 'hooks/use-marketo-form';
import PropTypes from 'prop-types';
import React, { memo } from 'react';

const MarketoForm = memo(({ debug, formId }) => {
useMarketo({
formId,
callback: () => {},
});

return <form id={`mktoForm_${formId}`} hidden={!debug} aria-hidden="true" />;
});

MarketoForm.defaultProps = {
debug: false,
};

MarketoForm.propTypes = {
debug: PropTypes.bool,
formId: PropTypes.string.isRequired,
};

export default MarketoForm;
3 changes: 3 additions & 0 deletions src/components/shared/subscribe-form/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import SubscribeForm from './subscribe-form';

export default SubscribeForm;
Loading