gatsby-core-theme 30.0.16 → 30.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/package.json +1 -1
  3. package/src/components/atoms/button/button.js +58 -0
  4. package/src/components/atoms/button/button.module.scss +144 -45
  5. package/src/components/atoms/{operator-cta-button/index.js → button/operator-cta.js} +1 -1
  6. package/src/components/atoms/{operator-cta-button/operator-cta-button.stories.js → button/operator-cta.stories.js} +2 -2
  7. package/src/components/atoms/{operator-cta-button/operator-cta-button.test.js → button/operator-cta.test.js} +1 -1
  8. package/src/components/atoms/search/autocomplete/operator.js +2 -2
  9. package/src/components/atoms/spotlights/index.js +2 -5
  10. package/src/components/molecules/bonus/template-one/index.js +1 -1
  11. package/src/components/molecules/bonus/template-two/index.js +1 -1
  12. package/src/components/molecules/bonus-box/template-three/index.js +1 -1
  13. package/src/components/molecules/bonus-box/template-two/index.js +1 -1
  14. package/src/components/molecules/carousel/default-slide/index.js +1 -28
  15. package/src/components/molecules/toplist/default-row/index.js +1 -1
  16. package/src/components/organisms/archive/archive.test.js +0 -1
  17. package/src/components/organisms/archive/index.js +4 -3
  18. package/src/components/organisms/carousel/carousel.test.js +0 -2
  19. package/src/components/organisms/cookie-consent/cookie-consent.test.js +1 -2
  20. package/src/components/organisms/cookie-consent/index.js +8 -5
  21. package/src/components/organisms/form/form.test.js +3 -3
  22. package/src/components/organisms/form/index.js +6 -4
  23. package/src/components/organisms/toplist/index.js +1 -3
  24. package/src/components/organisms/toplist/list/index.js +16 -36
  25. package/src/components/organisms/toplist/list/list.test.js +1 -1
  26. package/src/components/organisms/toplist/toplist.test.js +0 -12
  27. package/src/components/pages/tracker/index.js +3 -4
  28. package/src/components/pages/tracker-geo/index.js +1 -11
  29. package/src/helpers/processor/modules.mjs +9 -0
  30. package/src/components/atoms/button/button.stories.js +0 -185
  31. package/src/components/atoms/button/button.test.js +0 -45
  32. package/src/components/atoms/button/index.js +0 -89
  33. package/src/components/atoms/operator-cta-button/operator-cta-button.module.scss +0 -141
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## [30.0.18](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.17...v30.0.18) (2023-11-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * refactor data for deposit method ([53b8e27](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/53b8e27a9a889095eaae78be5bd864416d0f84a8))
7
+
8
+
9
+ * Merge branch 'refactor_deposit' into 'master' ([ec074cf](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/ec074cfd4f11c56152340933fcdcbbf5eef42734))
10
+
11
+ ## [30.0.17](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.16...v30.0.17) (2023-11-09)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * buttons ([02b1f07](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/02b1f0747c73fb75692bfb4de5f54267ada509ff))
17
+ * buttons and tests ([02647d7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/02647d7eaadfdf82f3b5e316610c74322d033d13))
18
+
19
+
20
+ * Merge branch 'tm-3755-buttons' into 'master' ([9430439](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/943043902e6a1b11401e28688f87f6e09efd45fb))
21
+
1
22
  ## [30.0.16](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.15...v30.0.16) (2023-11-08)
2
23
 
3
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "30.0.16",
3
+ "version": "30.0.18",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ import Link from '~hooks/link';
5
+ import styles from './button.module.scss';
6
+
7
+ function Button({
8
+ to = null,
9
+ btnText = 'Play now',
10
+ targetBlank = false,
11
+ buttonType = 'primary',
12
+ buttonSize = 'm',
13
+ isInternalLink = true,
14
+ onClick = null,
15
+ icon = null,
16
+ }) {
17
+ const classes = `${styles[buttonType] || ''} ${buttonSize ? styles[`${buttonSize}_size`] : ''} `;
18
+
19
+ const btnTitle = typeof btnText === 'string' ? btnText : '';
20
+
21
+ if (isInternalLink) {
22
+ return (
23
+ <Link className={`${classes}`} to={to} title={btnTitle} aria-label={btnTitle}>
24
+ {btnText}
25
+ {icon && icon}
26
+ </Link>
27
+ );
28
+ }
29
+
30
+ const linkAttr = to ? { href: to } : { onClick };
31
+
32
+ return (
33
+ <a
34
+ title={btnTitle}
35
+ aria-label={btnTitle}
36
+ target={targetBlank ? '_blank' : ''}
37
+ rel="nofollow noreferrer"
38
+ className={`${classes || ''}`}
39
+ {...linkAttr}
40
+ >
41
+ {btnText}
42
+ {icon && icon}
43
+ </a>
44
+ );
45
+ }
46
+
47
+ Button.propTypes = {
48
+ to: PropTypes.string,
49
+ icon: PropTypes.func,
50
+ btnText: PropTypes.oneOfType([PropTypes.string, PropTypes.any]),
51
+ targetBlank: PropTypes.bool,
52
+ isInternalLink: PropTypes.bool,
53
+ buttonType: PropTypes.string,
54
+ buttonSize: PropTypes.string,
55
+ onClick: PropTypes.func,
56
+ };
57
+
58
+ export default Button;
@@ -1,56 +1,155 @@
1
- @mixin secondaryBtn($color1, $color2) {
1
+ .primary {
2
+ @include buttonsColor(
3
+ var(--primary-button-color, #6e33e5),
4
+ var(--primary-button-color-hover, #331079),
5
+ var(--primary-button-color-active, #998fcb),
6
+ var(--primary-button-color-text, #ffffff)
7
+ );
8
+ white-space: nowrap;
9
+ border-radius: 100px;
10
+
11
+ &.not_recommended,
12
+ &.coming_soon,
13
+ &.inactive {
14
+ white-space: normal;
15
+ background-color: #bbb5dd;
16
+ color: #776aba;
17
+ }
18
+ }
19
+
20
+ .secondary {
21
+ @include buttonsColor(
22
+ var(--secondary-button-color, #1c1a28),
23
+ var(--secondary-button-color-hover, #515156),
24
+ var(--secondary-button-color-active, #3e3c47),
25
+ var(--secondary-button-color-text, #ffffff)
26
+ );
27
+ white-space: nowrap;
28
+ border-radius: 100px;
29
+
30
+ &.not_recommended,
31
+ &.coming_soon,
32
+ &.inactive {
33
+ white-space: normal;
34
+ background-color: #6b6a72;
35
+ color: #3e3c47;
36
+ }
37
+ }
38
+
39
+ .tertiary {
40
+ border-width: 1.5px;
41
+ border-style: solid;
42
+ border-color: #1c1a28;
2
43
  background-color: transparent;
3
- border: 0.2rem solid $color1;
4
- color: $color1;
44
+ color: #1c1a28;
45
+ white-space: nowrap;
46
+ border-radius: 100px;
47
+ display: inline-flex;
48
+ align-items: center;
49
+ justify-content: center;
5
50
 
6
51
  &:hover {
7
- background-color: $color1;
8
- border-color: $color1;
9
- color: $color2;
52
+ background-color: #1c1a28;
53
+ color: white;
54
+ border-color: #1c1a28;
55
+ }
56
+
57
+ &:active {
58
+ background-color: #33313d;
59
+ color: white;
60
+ border-color: #33313d;
61
+ }
62
+
63
+ &.not_recommended,
64
+ &.coming_soon,
65
+ &.inactive {
66
+ white-space: normal;
67
+ border-color: #9c9ab0;
68
+ color: #9c9ab0;
10
69
  }
11
70
  }
12
71
 
13
- .ctaBtn:not(.noStyle) {
14
- @include flex-align(center, center);
15
- white-space: nowrap;
16
- padding: 0.9rem 3rem;
72
+ .not_recommended,
73
+ .coming_soon,
74
+ .inactive {
75
+ padding: 1rem;
76
+ }
77
+
78
+ .xs_size {
79
+ padding: 0.4rem 0.8rem;
17
80
  font-weight: 700;
18
- font-size: 1.8rem;
19
- border-radius: var(--border-radius);
20
- text-align: center;
21
- display: inline-block;
22
- &.disabled,
23
- &:disabled {
24
- opacity: 0.5;
25
- pointer-events: none;
81
+ font-size: 1.1rem;
82
+ line-height: 1.6rem;
83
+ border-width: 1.5px;
84
+
85
+ > svg {
86
+ flex: none;
87
+ height: 0.8rem;
88
+ width: 0.8rem;
89
+ margin-left: 0.4rem;
26
90
  }
91
+ }
27
92
 
28
- &.primary {
29
- color: white;
30
- background-color: var(--primary-color);
31
-
32
- &:hover {
33
- background: linear-gradient(270deg, var(--color-27) 0.34%, var(--color-28) 86.37%);
34
- }
35
- }
36
-
37
- &.secondary {
38
- @include secondaryBtn(#ccc, #000);
39
- padding: 0.7rem 3rem;
40
-
41
- &.invertColors {
42
- @include secondaryBtn(#000, #fff);
43
- }
44
- &.tertiary {
45
- background-color: #ccc;
46
- border: none;
47
- color: #150e06;
48
- font-size: 1.6rem;
49
- padding: 0.9rem 3rem;
50
- &:hover {
51
- background-color: #150e06;
52
- color: #ccc;
53
- }
54
- }
93
+ .s_size {
94
+ padding: 0.4rem 1.6rem;
95
+ font-weight: 700;
96
+ font-size: 1.4rem;
97
+ line-height: 2rem;
98
+ border-width: 1.5px;
99
+
100
+ > svg {
101
+ flex: none;
102
+ height: 1.8rem;
103
+ width: 1.8rem;
104
+ margin-left: 1rem;
105
+ padding: 0.2rem;
106
+ }
107
+ }
108
+
109
+ .m_size {
110
+ font-weight: 700;
111
+ padding: 0.8rem 2.4rem;
112
+ font-size: 1.6rem;
113
+ line-height: 2.4rem;
114
+ border-width: 2px;
115
+
116
+ > svg {
117
+ flex: none;
118
+ height: 2.2rem;
119
+ width: 2.2rem;
120
+ margin-left: 11px;
121
+ padding: 0.2rem;
122
+ }
123
+ }
124
+
125
+ .l_size {
126
+ padding: 0.8rem 2.4rem;
127
+ font-weight: 700;
128
+ font-size: 2.2rem;
129
+ line-height: 3rem;
130
+ border-width: 2.5px;
131
+
132
+ > svg {
133
+ flex: none;
134
+ height: 3rem;
135
+ width: 3rem;
136
+ margin-left: 1.6rem;
137
+ padding: 0.2rem;
138
+ }
139
+ }
140
+
141
+ .xl_size {
142
+ padding: 1.6rem 3.2rem;
143
+ font-weight: 700;
144
+ font-size: 3.2rem;
145
+ line-height: 4rem;
146
+ border-width: 3px;
147
+
148
+ > svg {
149
+ flex: none;
150
+ height: 3.8rem;
151
+ width: 3.8rem;
152
+ margin-left: 1.8rem;
153
+ padding: 0.2rem;
55
154
  }
56
155
  }
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import { Context } from '~context/MainProvider';
4
4
  import { prettyTracker, translate } from '~helpers/getters';
5
5
 
6
- import styles from './operator-cta-button.module.scss';
6
+ import styles from './button.module.scss';
7
7
 
8
8
  const OperatorCtaButton = ({
9
9
  operator,
@@ -9,10 +9,10 @@ import {
9
9
  } from '@storybook/addon-docs/blocks';
10
10
  import { IoMdArrowRoundForward } from '@react-icons/all-files/io/IoMdArrowRoundForward';
11
11
 
12
- import OperatorCtaButton from '.';
12
+ import OperatorCtaButton from './operator-cta';
13
13
 
14
14
  export default {
15
- title: 'Theme/Atoms/Operator CTA Button',
15
+ title: 'Theme/Atoms/Button2',
16
16
  component: OperatorCtaButton,
17
17
  argTypes: {
18
18
  operator: {
@@ -4,7 +4,7 @@ import React from 'react';
4
4
  import { render, cleanup } from '@testing-library/react';
5
5
  import '@testing-library/jest-dom/extend-expect';
6
6
 
7
- import OperatorCtaButton from '.';
7
+ import OperatorCtaButton from './operator-cta';
8
8
 
9
9
  const data = (activeStatus = 'active') => ({
10
10
  operator: {
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
 
4
4
  import LazyImage from '~hooks/lazy-image';
5
5
  import { imagePrettyUrl } from '~helpers/getters';
6
- import Button from '~atoms/button';
6
+ import OperatorCta from '~atoms/button/operator-cta';
7
7
  import styles from './operator.module.scss';
8
8
 
9
9
  const Operator = ({ item = {} }) => {
@@ -14,7 +14,7 @@ const Operator = ({ item = {} }) => {
14
14
  <div className={styles.row || ''}>
15
15
  <LazyImage width={56} height={56} src={imagePrettyUrl(img, 56, 56)} alt={item.title} />
16
16
  <h3>{item.title}</h3>
17
- <Button to="/#" primaryColor isInternalLink={false} gtmClass="operator-gtm btn-cta" />
17
+ <OperatorCta operator={relation} gtmClass="toplist-operator-cta-gtm" />
18
18
  </div>
19
19
  );
20
20
  };
@@ -4,7 +4,7 @@
4
4
  /* eslint-disable camelcase */
5
5
  import React, { useContext } from 'react';
6
6
  import PropTypes from 'prop-types';
7
- import Button from '~atoms/button';
7
+ import Button from '~atoms/button/button';
8
8
  import imgSize from '~constants/spotlight-image-dimensions.js';
9
9
  import LazyImage from '~hooks/lazy-image';
10
10
  import keygen from '~helpers/keygen';
@@ -90,11 +90,8 @@ const Spotlights = ({ module, themeStyles = {} }) => {
90
90
  {item?.text && <div dangerouslySetInnerHTML={{ __html: item.text }} />}
91
91
  <Button
92
92
  to={item.link.value}
93
- isAnchorLink
94
93
  isInternalLink={!(item.link.type === 'external')}
95
- rel={item.link.type === 'external' ? 'noreferrer' : ''}
96
- invertColors
97
- primaryColor={false}
94
+ buttonType="tertiary"
98
95
  gtmClass="spotlights-gtm"
99
96
  btnText={
100
97
  item.link_text
@@ -5,7 +5,7 @@ import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
5
5
  import { prettyTracker, imagePrettyUrl } from '~helpers/getters';
6
6
  import LazyImage from '~hooks/lazy-image';
7
7
  import BonusBox from '~molecules/bonus-box/template-four';
8
- import OperatorCta from '~atoms/operator-cta-button';
8
+ import OperatorCta from '~atoms/button/operator-cta';
9
9
  import Rating from '~molecules/star-rating/one-star';
10
10
  import Tnc from '~molecules/tnc';
11
11
  import styles from './bonus.module.scss';
@@ -7,7 +7,7 @@ import { prettyTracker, imagePrettyUrl, translate } from '~helpers/getters';
7
7
  import LazyImage from '~hooks/lazy-image';
8
8
  import isSticky from '~hooks/stickyOnScroll';
9
9
  import BonusBox from '~molecules/bonus-box/template-four';
10
- import OperatorCta from '~atoms/operator-cta-button';
10
+ import OperatorCta from '~atoms/button/operator-cta';
11
11
  import Rating from '~molecules/star-rating/one-star';
12
12
  import Tnc from '~molecules/tnc';
13
13
  import { Context } from '~context/MainProvider';
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
4
4
  import { translate, prettyTracker, getBonusData } from '~helpers/getters.mjs';
5
5
  import { Context } from '~context/MainProvider';
6
- import CtaButton from '../../../atoms/operator-cta-button';
6
+ import CtaButton from '../../../atoms/button/operator-cta';
7
7
  import styles from './bonus-box.module.scss';
8
8
  import VariableComponent from '../variables';
9
9
 
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
4
4
  import { prettyTracker, getBonusData } from '~helpers/getters.mjs';
5
- import CtaButton from '../../../atoms/operator-cta-button';
5
+ import CtaButton from '../../../atoms/button/operator-cta';
6
6
  import styles from './bonus-box.module.scss';
7
7
 
8
8
  export default function BonusBox({
@@ -5,16 +5,9 @@ import PropTypes from 'prop-types';
5
5
 
6
6
  import LazyImage from '~hooks/lazy-image';
7
7
  import { imagePrettyUrl, getAltText } from '~helpers/getters';
8
- import Button from '~atoms/button';
9
8
  import styles from './default-slide.module.scss';
10
9
 
11
- const Slide = ({
12
- item = {},
13
- primaryBtnText = '',
14
- secondaryBtnText = '',
15
- imageSizes = { width: null, height: 930 },
16
- slideTitle = '',
17
- }) => {
10
+ const Slide = ({ item = {}, imageSizes = { width: null, height: 930 }, slideTitle = '' }) => {
18
11
  return (
19
12
  <>
20
13
  {item.title && <span className={styles.title || ''}>{item.title}</span>}
@@ -26,26 +19,6 @@ const Slide = ({
26
19
  />
27
20
  )}
28
21
  {item.content && <p className={styles.content || ''}>{item.content}</p>}
29
- {item.primary_action && (
30
- <Button
31
- className={styles.primaryBtn || ''}
32
- to={item.primary_action}
33
- btnText={primaryBtnText}
34
- isInternalLink={false}
35
- primaryColor
36
- gtmClass="carousel-gtm btn-cta"
37
- />
38
- )}
39
- {item.secondary_action && (
40
- <Button
41
- className={styles.secondaryBtn || ''}
42
- to={item.primary_action}
43
- btnText={secondaryBtnText}
44
- isInternalLink={false}
45
- primaryColor={false}
46
- gtmClass="carousel-gtm btn-cta"
47
- />
48
- )}
49
22
  {item.label && <span className={styles.label}>{item.label}</span>}
50
23
  </>
51
24
  );
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
5
5
  import Bonus from '~molecules/bonus-box/template-one';
6
6
  import SellingPoints from '~atoms/selling-points';
7
7
  import ReviewLink from '../../../atoms/review-link';
8
- import OperatorCta from '~atoms/operator-cta-button';
8
+ import OperatorCta from '~atoms/button/operator-cta';
9
9
  import { prettyTracker, imagePrettyUrl, getAltText } from '~helpers/getters';
10
10
  import LazyImage from '~hooks/lazy-image';
11
11
 
@@ -35,7 +35,6 @@ describe('archive component', () => {
35
35
  }}
36
36
  />
37
37
  );
38
- expect(container.querySelectorAll('button')).toHaveLength(1);
39
38
  expect(getByText('Load More')).toBeTruthy();
40
39
 
41
40
  // click
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
4
4
 
5
5
  import Pagination from '~molecules/pagination';
6
6
  import Items from '~atoms/archive/items';
7
- import Button from '~atoms/button';
7
+ import Button from '~atoms/button/button';
8
8
  import { translate } from '~helpers/getters';
9
9
  import { Context } from '~context/MainProvider';
10
10
  import styles from './archive.module.scss';
@@ -44,9 +44,10 @@ const Archive = ({ module, page, loadMore, gtmClass = '', anchorLabel }) => {
44
44
  <Button
45
45
  btnText={translate(translations, 'load_more', 'Load More')}
46
46
  onClick={loadMoreHandler}
47
- isButton
48
- primaryColor
47
+ buttonType="tertiary"
48
+ buttonSize="m"
49
49
  gtmClass="archive-gtm btn-cta"
50
+ isInternalLink={false}
50
51
  />
51
52
  </div>
52
53
  )
@@ -16,8 +16,6 @@ describe('Carousel Component', () => {
16
16
  expect(getAllByText('title 1')).toBeTruthy();
17
17
 
18
18
  expect(container.querySelectorAll('.sliderItem span.title')).toHaveLength(2);
19
- expect(container.querySelectorAll('.sliderItem a.primary')).toHaveLength(1);
20
- expect(container.querySelectorAll('.sliderItem a.secondary')).toHaveLength(1);
21
19
  expect(container.querySelectorAll('.sliderItem span.label')).toHaveLength(2);
22
20
  });
23
21
  });
@@ -43,8 +43,7 @@ describe('cookie consent component', () => {
43
43
  expect(navigate).toHaveBeenCalled();
44
44
  });
45
45
  test('Buttons', () => {
46
- const { container, getByText } = renderComponent();
47
- expect(container.querySelectorAll('button')).toHaveLength(2);
46
+ const { getByText } = renderComponent();
48
47
  expect(getByText('Accept Me')).toBeTruthy();
49
48
  expect(getByText('Decline Me')).toBeTruthy();
50
49
  });
@@ -5,7 +5,7 @@ import { navigate } from 'gatsby';
5
5
  import Modal from 'gatsby-core-theme/src/hooks/modal';
6
6
  import { ModalContext } from 'gatsby-core-theme/src/hooks/modal/modalContext';
7
7
  import Sticky from '~molecules/sticky';
8
- import Button from '~atoms/button';
8
+ import Button from '~atoms/button/button';
9
9
  import { translate } from '~helpers/getters';
10
10
  import { Context } from '~context/MainProvider';
11
11
  import { setCookie, getCookie } from '~helpers/cookies';
@@ -14,7 +14,7 @@ import styles from './cookie-consent.module.scss';
14
14
  const CookieConsent = ({
15
15
  acceptText = 'Accept',
16
16
  settingsCookie = false,
17
- declineText,
17
+ declineText = 'Decline',
18
18
  declineURL = '#',
19
19
  location = 'bottom',
20
20
  children,
@@ -55,7 +55,8 @@ const CookieConsent = ({
55
55
  <Button
56
56
  btnText={translate(translations, 'cookie_setting_button', 'Cookie Setting')}
57
57
  isInternalLink={false}
58
- isButton
58
+ buttonType="terti"
59
+ buttonSize="m"
59
60
  gtmClass="cookie-consent-gtm btn-cta"
60
61
  />
61
62
  </Modal>
@@ -65,7 +66,8 @@ const CookieConsent = ({
65
66
  onClick={() => handleAccept()}
66
67
  btnText={translate(translations, 'cookie_accept_button', acceptText)}
67
68
  isInternalLink={false}
68
- isButton
69
+ buttonType="primary"
70
+ buttonSize="m"
69
71
  gtmClass="cookie-consent-gtm btn-cta"
70
72
  />
71
73
 
@@ -74,7 +76,8 @@ const CookieConsent = ({
74
76
  onClick={() => handleDecline()}
75
77
  btnText={translate(translations, 'cookie_decline_button', declineText)}
76
78
  isInternalLink={false}
77
- isButton
79
+ buttonType="secondary"
80
+ buttonSize="m"
78
81
  gtmClass="cookie-consent-gtm btn-cta"
79
82
  />
80
83
  )}
@@ -22,7 +22,7 @@ describe('Form Component', () => {
22
22
  expect(container.querySelector('textarea')).toBeTruthy();
23
23
  expect(container.querySelector('label')).toBeTruthy();
24
24
  expect(container.querySelectorAll('label').length).toEqual(5);
25
- expect(container.querySelector('button')).toBeTruthy();
25
+ expect(container.querySelector('.primary')).toBeTruthy();
26
26
  });
27
27
  test('render newsletter form ', () => {
28
28
  const { container } = render(
@@ -36,7 +36,7 @@ describe('Form Component', () => {
36
36
  expect(container.querySelector('input[type="text"]')).toBeTruthy();
37
37
  expect(container.querySelector('input[type="email"]')).toBeTruthy();
38
38
  expect(container.querySelector('textarea')).toBeFalsy();
39
- expect(container.querySelector('button')).toBeTruthy();
39
+ expect(container.querySelector('.primary')).toBeTruthy();
40
40
  });
41
41
  test('render form without labels ', () => {
42
42
  const { container } = render(
@@ -86,7 +86,7 @@ describe('Form Component', () => {
86
86
  container
87
87
  );
88
88
  });
89
- const button = container.querySelector('button');
89
+ const button = container.querySelector('.primary');
90
90
  const ApiCall = jest.fn();
91
91
  screen.postData = new ApiCall();
92
92
  act(() => {
@@ -5,7 +5,7 @@ import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
5
5
  import { translate } from 'gatsby-core-theme/src/helpers/getters';
6
6
  import { Context } from 'gatsby-core-theme/src/context/MainProvider';
7
7
  import { contactUsForm } from '../../../constants/forms';
8
- import Button from '~atoms/button';
8
+ import Button from '~atoms/button/button';
9
9
  import styles from './form.module.scss';
10
10
 
11
11
  const FormComponent = ({
@@ -22,6 +22,7 @@ const FormComponent = ({
22
22
  }) => {
23
23
  const { translations } = useContext(Context) || {};
24
24
  const recaptchaRef = useRef();
25
+ const formRef = useRef();
25
26
  const [state, setState] = useState({
26
27
  loading: false,
27
28
  success: false,
@@ -258,6 +259,7 @@ const FormComponent = ({
258
259
  )}
259
260
  {formOptions?.fields && (
260
261
  <form
262
+ ref={formRef}
261
263
  onSubmit={(e) => handleSubmit(e)}
262
264
  action={submitUrl}
263
265
  className={formOptions.twoCol ? styles.twoCol || '' : styles.singleCol || ''}
@@ -315,11 +317,11 @@ const FormComponent = ({
315
317
  {hasButton && (
316
318
  <div className={styles.formButton || ''}>
317
319
  <Button
318
- isButton
320
+ buttonType="primary"
321
+ isInternalLink={false}
319
322
  btnText={state.loading ? 'sending...' : buttonLabel}
320
- disabled={state.loading}
321
323
  gtmClass="form-gtm btn-cta"
322
- primaryColor
324
+ onClick={(e) => handleSubmit(e)}
323
325
  icon={
324
326
  showButtonIcon ? (
325
327
  <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />
@@ -5,7 +5,7 @@ import keygen from '~helpers/keygen';
5
5
  import List from './list';
6
6
  import styles from './toplist.module.scss';
7
7
 
8
- const TopList = ({ module, toplistHeading, CustomRow, page }) => {
8
+ const TopList = ({ module, toplistHeading, page }) => {
9
9
  const showTabs = module.items.length > 1;
10
10
  const content = module.items.map((toplist) => (
11
11
  <div
@@ -16,7 +16,6 @@ const TopList = ({ module, toplistHeading, CustomRow, page }) => {
16
16
  {toplistHeading}
17
17
  <List
18
18
  toplist={toplist}
19
- CustomRow={CustomRow}
20
19
  hasLoadMoreButton={toplist.show_load_more}
21
20
  initItemsCount={toplist.num_items_initial_load}
22
21
  loadItemsCount={toplist.num_items_load_more}
@@ -38,7 +37,6 @@ TopList.propTypes = {
38
37
  // eslint-disable-next-line react/forbid-prop-types
39
38
  module: PropTypes.shape({ items: PropTypes.arrayOf(PropTypes.object) }),
40
39
  toplistHeading: PropTypes.element,
41
- CustomRow: PropTypes.func,
42
40
  page: PropTypes.shape({ template: PropTypes.string }),
43
41
  };
44
42