gatsby-matrix-theme 28.0.18 → 29.0.0

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 (57) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/package.json +2 -2
  3. package/src/components/atoms/cards/operator-card/template-four/index.js +1 -1
  4. package/src/components/atoms/footer/as-seen-on/as-seen-on.module.scss +5 -3
  5. package/src/components/atoms/footer/as-seen-on/index.js +1 -1
  6. package/src/components/atoms/ratings/index.js +80 -40
  7. package/src/components/atoms/ratings/ratings.module.scss +102 -53
  8. package/src/components/atoms/site-contacts/index.js +32 -0
  9. package/src/components/atoms/site-contacts/site-contacts.module.scss +29 -0
  10. package/src/components/atoms/site-contacts/site-contacts.stories.js +57 -0
  11. package/src/components/atoms/site-contacts/site-contacts.test.js +43 -0
  12. package/src/components/atoms/social-icons/social-icons.module.scss +32 -27
  13. package/src/components/molecules/header/variants/operator/template-four/index.js +1 -1
  14. package/src/components/molecules/header/variants/operator/template-one-two/index.js +1 -1
  15. package/src/components/molecules/header/variants/operator/template-three/index.js +1 -1
  16. package/src/components/molecules/header/variants/payment/template-four/index.js +1 -1
  17. package/src/components/molecules/header/variants/payment/template-one-three/index.js +1 -1
  18. package/src/components/molecules/header/variants/slot/template-one/index.js +3 -11
  19. package/src/constants/ratings-constant.js +29 -8
  20. package/src/gatsby-core-theme/components/atoms/contact-form/contact-form.module.scss +101 -0
  21. package/src/{components/pages/contact-us/contact-us.stories.js → gatsby-core-theme/components/atoms/contact-form/contact-form.stories.js} +18 -22
  22. package/src/gatsby-core-theme/components/atoms/contact-form/contact-form.test.js +76 -0
  23. package/src/gatsby-core-theme/components/atoms/contact-form/index.js +102 -0
  24. package/src/gatsby-core-theme/components/molecules/main/index.js +8 -3
  25. package/src/gatsby-core-theme/components/molecules/module/index.js +7 -0
  26. package/src/gatsby-core-theme/components/pages/body/index.js +26 -37
  27. package/src/gatsby-core-theme/constants/forms.js +100 -0
  28. package/storybook/public/{238.3a277b33.iframe.bundle.js → 238.37a0b647.iframe.bundle.js} +1 -1
  29. package/storybook/public/{343.400c65ee.iframe.bundle.js → 343.fc9c5b8f.iframe.bundle.js} +1 -1
  30. package/storybook/public/{408.d119cdeb.iframe.bundle.js → 408.7984135f.iframe.bundle.js} +2 -2
  31. package/storybook/public/{503.0b8b8998.iframe.bundle.js → 452.fd4ba785.iframe.bundle.js} +4 -4
  32. package/storybook/public/{503.0b8b8998.iframe.bundle.js.map → 452.fd4ba785.iframe.bundle.js.map} +1 -1
  33. package/storybook/public/{555.64ab0ebd.iframe.bundle.js → 555.19082e83.iframe.bundle.js} +1 -1
  34. package/storybook/public/{60.ac26b50b.iframe.bundle.js → 60.b5d116a5.iframe.bundle.js} +1 -1
  35. package/storybook/public/694.8483833e.iframe.bundle.js +1 -0
  36. package/storybook/public/{895.ef180356.iframe.bundle.js → 895.3984ff11.iframe.bundle.js} +1 -1
  37. package/storybook/public/{917.d52a9015.iframe.bundle.js → 917.69d320d0.iframe.bundle.js} +1 -1
  38. package/storybook/public/932.b2fa9f2a.iframe.bundle.js +1 -0
  39. package/storybook/public/iframe.html +1 -1
  40. package/storybook/public/main.c44bfce5.iframe.bundle.js +2 -0
  41. package/storybook/public/runtime~main.e1583481.iframe.bundle.js +1 -0
  42. package/src/components/atoms/rating/index.js +0 -77
  43. package/src/components/atoms/rating/ratings.module.scss +0 -116
  44. package/src/components/atoms/ratings/ratings.stories.js +0 -25
  45. package/src/components/atoms/ratings/ratings.test.js +0 -38
  46. package/src/components/pages/contact-us/contact-us.module.scss +0 -86
  47. package/src/components/pages/contact-us/contact-us.test.js +0 -26
  48. package/src/components/pages/contact-us/index.js +0 -93
  49. package/storybook/public/203.1d199f29.iframe.bundle.js +0 -1
  50. package/storybook/public/346.45d0e266.iframe.bundle.js +0 -1
  51. package/storybook/public/694.dd38cc79.iframe.bundle.js +0 -1
  52. package/storybook/public/main.a04c17df.iframe.bundle.js +0 -2
  53. package/storybook/public/runtime~main.bcbb6c21.iframe.bundle.js +0 -1
  54. /package/src/components/atoms/{rating → ratings}/rating.test.js +0 -0
  55. /package/storybook/public/{408.d119cdeb.iframe.bundle.js.LICENSE.txt → 408.7984135f.iframe.bundle.js.LICENSE.txt} +0 -0
  56. /package/storybook/public/{503.0b8b8998.iframe.bundle.js.LICENSE.txt → 452.fd4ba785.iframe.bundle.js.LICENSE.txt} +0 -0
  57. /package/storybook/public/{main.a04c17df.iframe.bundle.js.LICENSE.txt → main.c44bfce5.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,38 @@
1
+ # [29.0.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v28.0.18...v29.0.0) (2023-08-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added section styles for footer component ([830e1e5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/830e1e55d21d68c8d8fec0d6a6f2756b8aa09ff8))
7
+ * added section styles for footer component ([86e5031](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/86e5031fb636b26d903f5f57eb630e4413c1e8b6))
8
+ * cleanup ratings components ([a192fa3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a192fa3d435488bb22559454389452d03d3a6f62))
9
+ * convert title to span ([56a9d08](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/56a9d08ec3650862651e6c9ec71688ec403bb053))
10
+ * get data from market if we dont have on site tab ([6ed5df1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6ed5df1817676bf84dd16021b3b127da3a57c626))
11
+
12
+
13
+ ### Code Refactoring
14
+
15
+ * avoid displaying component if contents are empty ([9adfb6d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9adfb6d54d8d79b3b258415521078a946356da36))
16
+ * change to fields when not available ([643b299](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/643b299d7a9cba6ff5160fd6b3a32f0c349d3a0d))
17
+ * changes to email in case its not available on sites ([9b61e29](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9b61e295c749de9764e9071a0670d48c3c31ee76))
18
+ * changes to site contacts ([7cb7add](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7cb7add6bb76120b11c0f441a6da7d1c79d2bc70))
19
+ * minor css change for email container ([1ba39d3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/1ba39d32ae3517c4d7b7890834519c77f4c2bf00))
20
+ * move template block to correct position on storybook ([ec6e58a](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ec6e58a560fb42b9036cd591249adbcd85849bf0))
21
+ * new contact us ([f1e68d9](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/f1e68d9b2612cdb62ebd0c508955c9611e50aa55))
22
+ * remove contact us page and fix tests for contact form ([c19081d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/c19081df61ed5a4ed1c8a8c43f75bf20a43edc4c))
23
+
24
+
25
+ ### Config
26
+
27
+ * update to latest core theme and use new form and contact us page ([3d7b793](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/3d7b7935d323e27c7a7076d95ae4164c5e8e3868))
28
+
29
+
30
+ * Merge branch 'tm-3420-section-styles' into 'master' ([25bc6e8](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/25bc6e87eb178b00d7cfe5584477104b54803d59))
31
+ * Merge branch 'tm-3634-ratings' into 'master' ([4b1ce5d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4b1ce5d144d7a51b5bcf4e1beb3d51d141830871))
32
+ * Merge branch 'tm-3556-contact-us-page' into 'master' ([b21f17d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b21f17d989f3d88b6bb26580474a1c3461a9b197))
33
+ * Merge branch 'master' into tm-3556-contact-us-page ([19c404c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/19c404ce9e03eeecc7bb394780e25cc62d024ed3))
34
+ * Merge branch 'tm-3599-as-seen-on-title' into 'master' ([6d1b942](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6d1b9421ba6ef6a12dcfc8fe841719d25e7760bd))
35
+
1
36
  ## [28.0.18](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v28.0.17...v28.0.18) (2023-08-15)
2
37
 
3
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "28.0.18",
3
+ "version": "29.0.0",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@react-icons/all-files": "^4.1.0",
27
27
  "gatsby": "^5.11.0",
28
- "gatsby-core-theme": "25.0.14",
28
+ "gatsby-core-theme": "26.0.0",
29
29
  "gatsby-plugin-sharp": "^5.11.0",
30
30
  "gatsby-plugin-sitemap": "^3.3.0",
31
31
  "gatsby-transformer-sharp": "^5.11.0",
@@ -17,7 +17,7 @@ import Bonus from 'gatsby-core-theme/src/components/atoms/bonus';
17
17
  import ReviewLink from 'gatsby-core-theme/src/components/atoms/review-link';
18
18
  import { Context } from 'gatsby-core-theme/src/context/MainProvider';
19
19
  import OperatorCta from 'gatsby-core-theme/src/components/atoms/operator-cta-button';
20
- import Rating from '../../../rating';
20
+ import Rating from '../../../ratings';
21
21
  import styles from './template-four.module.scss';
22
22
 
23
23
  const TemplateFour = ({
@@ -12,7 +12,7 @@
12
12
  padding: 48px 0px;
13
13
  }
14
14
 
15
- > h5,
15
+ > span,
16
16
  > ul {
17
17
  @include min(tablet) {
18
18
  margin: 0 auto;
@@ -20,8 +20,10 @@
20
20
  }
21
21
  }
22
22
 
23
- > h5 {
23
+ > span {
24
+ font-size: var(--h5-size);
24
25
  margin-top: 0;
26
+ font-weight: 700;
25
27
  margin-bottom: 0;
26
28
  color: var(--footer-asSeenOn-text-color, var(--color-49));
27
29
  }
@@ -63,7 +65,7 @@
63
65
  @include flex-align(flex-start, flex-start);
64
66
  padding: 0;
65
67
 
66
- > h5,
68
+ > span,
67
69
  > ul {
68
70
  margin: 0;
69
71
  }
@@ -9,7 +9,7 @@ const AsSeenOn = ({ asSeenOn, template }) => (
9
9
  template && styles[template] ? styles[template] || '' : ''
10
10
  }`}
11
11
  >
12
- <h5>As Seen On:</h5>
12
+ <span>As Seen On:</span>
13
13
  <LinkList
14
14
  showListTitle={false}
15
15
  imageOnly
@@ -1,54 +1,94 @@
1
+ /* eslint-disable camelcase */
2
+ /* eslint-disable no-nested-ternary */
1
3
  import React, { useContext } from 'react';
2
4
  import PropTypes from 'prop-types';
3
-
4
- import { FaStar } from '@react-icons/all-files/fa/FaStar';
5
- import { translate } from 'gatsby-core-theme/src/helpers/getters';
6
5
  import { Context } from 'gatsby-core-theme/src/context/MainProvider';
6
+ import { translate, getObjectValue } from 'gatsby-core-theme/src/helpers/getters';
7
+ import keygen from 'gatsby-core-theme/src/helpers/keygen';
8
+ import operatorRatings from '../../../constants/ratings-constant';
9
+
7
10
  import styles from './ratings.module.scss';
8
11
 
9
- const Ratings = ({ averageRating, ratings, relation }) => {
12
+ export default function Ratings({ item, type, numOfStars = 5, currency = '€' }) {
10
13
  const { translations } = useContext(Context) || {};
11
- const votalityValue = relation?.volatility ? relation?.volatility : 0;
12
- const rangeText = { 0: 'Low', 1: 'Medium', 2: 'High' }[votalityValue] || '0%';
14
+
15
+ const ratings = operatorRatings[type] || [];
16
+ const rangeText = { 0: 'Low', 1: 'Medium', 2: 'High' };
17
+
18
+ // (item?.bonus || item) for the games we don't have ratings in market
19
+ const ratingsData = operatorRatings.ratingProperties.some((prop) => item[prop])
20
+ ? item
21
+ : item?.bonus || item;
22
+
23
+ if (!ratings.length) {
24
+ return null;
25
+ }
13
26
 
14
27
  return (
15
- <ul className={styles?.ratings || ''}>
16
- <li key="Overall">
17
- <p>{translate(translations, 'overall', 'Overall')}</p>
18
- <div>
19
- <FaStar />
20
- <p data-testid="overall-rating">{averageRating}/</p>
21
- <p>5</p>
22
- </div>
23
- </li>
24
- {ratings?.map((rating) => (
25
- <li key={rating[rating?.field_name]}>
26
- <p>{rating?.field_label}</p>
27
- {rating?.field_name === 'rtp' ? (
28
- <p>{relation[rating?.field_name]}%</p>
29
- ) : (
30
- <div>
31
- <FaStar />
32
- <p>{relation[rating?.field_name]}/</p>
33
- <p>5</p>
34
- </div>
35
- )}
36
- </li>
37
- ))}
38
- <li>
39
- <p>{translate(translations, 'volatility', 'Volatility')}</p>
40
- <div className={styles?.bar || ''}>{rangeText}</div>
41
- </li>
28
+ <ul className={`${styles?.ratingList || ''}`}>
29
+ {ratings?.map((rating) => {
30
+ const { fieldValue, translationKey, fieldLabel, componentToUse } = rating || {};
31
+ let valueDiplayed;
32
+ const value = getObjectValue(ratingsData, fieldValue);
33
+ const component = componentToUse ? componentToUse(numOfStars, value, currency) : false;
34
+
35
+ if (component && value) {
36
+ valueDiplayed = component || '-';
37
+ } else if (fieldValue.includes('volatility')) {
38
+ valueDiplayed = rangeText[getObjectValue(ratingsData, fieldValue)] || '-';
39
+ } else {
40
+ valueDiplayed = value || '-';
41
+ }
42
+
43
+ if (['coming_soon', 'inactive'].includes(item?.status)) {
44
+ valueDiplayed = 'TBA';
45
+ }
46
+
47
+ return (
48
+ <li
49
+ key={keygen()}
50
+ className={`${styles?.item || ''} ${
51
+ rating?.showOnlyMobile ? styles?.showOnlyMobile || '' : ''
52
+ }`}
53
+ >
54
+ <p className={styles?.label || ''}>
55
+ {translate(translations, translationKey, fieldLabel)}
56
+ </p>
57
+
58
+ {valueDiplayed === 'TBA' ? (
59
+ <p className={`${styles?.value || ''} ${styles?.tbaValue}`}>
60
+ {translate(translations, 'tba', 'TBA')}
61
+ </p>
62
+ ) : (
63
+ <>
64
+ {valueDiplayed}
65
+ {fieldValue === 'rtp' && '%'}
66
+ </>
67
+ )}
68
+ </li>
69
+ );
70
+ })}
42
71
  </ul>
43
72
  );
44
- };
73
+ }
45
74
 
46
75
  Ratings.propTypes = {
47
- averageRating: PropTypes.string,
48
- // eslint-disable-next-line react/forbid-prop-types
49
- ratings: PropTypes.array,
50
- relation: PropTypes.shape({
51
- volatility: PropTypes.string,
76
+ item: PropTypes.shape({
77
+ name: PropTypes.string,
78
+ bonus: PropTypes.shape({}),
79
+ rating: PropTypes.string,
80
+ status: PropTypes.string,
81
+ rating_bonuses: PropTypes.string,
82
+ rating_casino: PropTypes.string,
83
+ rating_customer: PropTypes.string,
84
+ rating_games: PropTypes.string,
85
+ rating_payout: PropTypes.string,
86
+ first_rating: PropTypes.string,
87
+ second_rating: PropTypes.string,
88
+ third_rating: PropTypes.string,
89
+ fourth_rating: PropTypes.string,
52
90
  }),
91
+ type: PropTypes.string,
92
+ numOfStars: PropTypes.string,
93
+ currency: PropTypes.string,
53
94
  };
54
- export default Ratings;
@@ -1,67 +1,116 @@
1
- .ratings {
2
- display: flex;
3
- margin: 0rem;
4
- height: 100%;
5
- gap: 0.8rem;
1
+ .ratingList {
2
+ @include flex-direction(row);
6
3
  overflow-x: scroll;
4
+ gap: 0.8rem;
5
+
6
+ &::-webkit-scrollbar {
7
+ width: 3px;
8
+ height: 3px;
9
+ background-color: transparent;
10
+ }
11
+
12
+ &::-webkit-scrollbar-thumb {
13
+ border-radius: 100px;
14
+ background: #929292;
15
+ }
16
+
7
17
  @include min(tablet) {
18
+ display: flex;
19
+ flex-wrap: nowrap;
8
20
  overflow: hidden;
9
- gap: 1.6rem;
10
- > :first-child {
11
- display: none;
12
- }
13
21
  }
14
- > li,
15
- > div {
22
+ }
23
+
24
+ .item {
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ flex-direction: column;
29
+ font-weight: 700;
30
+ font-size: 1.4rem;
31
+ background-color: #fbfbfb;
32
+ border: 1px solid #e9e9e9;
33
+ border-radius: 8px;
34
+ padding: 16px 8px;
35
+ min-height: 9.6rem;
36
+ min-width: 10.4rem;
37
+
38
+ @include min(tablet) {
16
39
  margin-bottom: inherit;
17
- width: 100%;
18
- background: #fbfbfb;
19
- padding: 16px 8px;
20
- min-width: 10.4rem;
21
- height: 9.6rem;
22
- box-shadow: 4px 4px 30px rgb(0 0 0 / 3%);
23
- font-weight: bold;
24
- font-size: 1.4rem;
25
- border-radius: 8px;
26
- border: 1px solid #e9e9e9;
27
- @include flex-direction(column);
28
- @include flex-align(center, space-evenly);
29
- color: #1c1a28;
30
- > p {
40
+ width: -webkit-fill-available;
41
+ }
42
+
43
+ // Star rating
44
+ >div {
45
+ display: inline-flex;
46
+ align-items: center;
47
+ font-weight: 800;
48
+ font-size: 18px;
49
+ line-height: 28px;
50
+ border: none;
51
+ background-color: #fbfbfb;
52
+
53
+ >svg {
54
+ width: 18.35px;
55
+ height: 17.49px;
56
+ color: var(--rating-star-color, #ffdb20);
57
+ margin-right: 5.82px;
58
+ }
59
+
60
+ >span:last-child {
61
+ font-size: 16px;
62
+ line-height: 27px;
31
63
  font-weight: 700;
32
- font-size: 1.2rem;
33
- line-height: 2rem;
34
- color: #1c1a28;
64
+
35
65
  @include min(tablet) {
36
- font-size: 14px;
37
- line-height: 22px;
38
- }
39
- }
40
- > div {
41
- display: flex;
42
- align-items: center;
43
- > svg {
44
- color: #ffdb20;
45
- height: 1.8rem;
46
- width: 1.8rem;
47
- margin-right: 6px;
48
- }
49
- > p {
50
- color: #1c1a28;
51
66
  font-weight: 800;
52
67
  font-size: 18px;
53
68
  line-height: 28px;
54
69
  }
55
- @include max(mobile) {
56
- > :last-child {
57
- font-size: 1.6rem;
58
- line-height: 2.7rem;
59
- margin-top: 1px;
60
- }
61
- }
62
- }
63
- @include min(tablet) {
64
- height: 11.2rem;
65
70
  }
66
71
  }
67
72
  }
73
+
74
+ .label {
75
+ font-weight: 700;
76
+ font-size: 12px;
77
+ line-height: 20px;
78
+ color: #1c1a28;
79
+ padding-bottom: 0.8rem;
80
+ text-align: center;
81
+
82
+ @include min(tablet) {
83
+ font-size: 14px;
84
+ line-height: 22px;
85
+ }
86
+ }
87
+
88
+ .value {
89
+ font-weight: 700;
90
+ font-size: 18px;
91
+ line-height: 28px;
92
+ color: #1c1a28;
93
+ display: flex;
94
+
95
+ >svg {
96
+ width: 2rem;
97
+ height: 2rem;
98
+ }
99
+
100
+ @include min(tablet) {
101
+ font-weight: 800;
102
+ }
103
+ }
104
+
105
+ .tbaValue {
106
+ color: #33313d;
107
+ font-weight: 700;
108
+ font-size: 14px;
109
+ line-height: 22px;
110
+ }
111
+
112
+ .showOnlyMobile {
113
+ @include min(tablet) {
114
+ display: none;
115
+ }
116
+ }
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import keygen from 'gatsby-core-theme/src/helpers/keygen';
4
+ import styles from './site-contacts.module.scss';
5
+
6
+ const SiteContacts = ({ page }) => {
7
+ const { siteSchema } = page || {};
8
+ const email = siteSchema?.email || null;
9
+
10
+ if (!email) return;
11
+
12
+ return (
13
+ <div className={styles.siteContacts}>
14
+ <ul className={styles?.generalContacts || ''}>
15
+ {email?.map((item) => (
16
+ <li key={keygen()}>
17
+ <p>{item.contact_type}</p>
18
+ <a href={`mailto:${item.email}`}>{item.email}</a>
19
+ </li>
20
+ ))}
21
+ </ul>
22
+ </div>
23
+ );
24
+ };
25
+
26
+ export default SiteContacts;
27
+
28
+ SiteContacts.propTypes = {
29
+ page: PropTypes.shape({
30
+ siteSchema: PropTypes.shape({}),
31
+ }).isRequired,
32
+ };
@@ -0,0 +1,29 @@
1
+ .generalContacts {
2
+ @include flex-direction(column);
3
+ gap: 1.6rem;
4
+
5
+ @include min(tablet) {
6
+ display: grid;
7
+ grid-template-columns: repeat(3, minmax(0, 1fr));
8
+ }
9
+
10
+ li {
11
+ border-radius: 0.8rem;
12
+ flex-grow: 1;
13
+ padding: 2.4rem;
14
+ background-color: white;
15
+ box-shadow: 0 4px 16px rgba(8,32,46,.1);
16
+
17
+ > p {
18
+ color: var(--color-3);
19
+ font-size: 1.6rem;
20
+ font-weight: 400;
21
+ }
22
+
23
+ > a {
24
+ font-size: 1.4rem;
25
+ font-weight: 700;
26
+ text-decoration: underline;
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,57 @@
1
+ import React from 'react';
2
+ // eslint-disable-next-line import/no-extraneous-dependencies
3
+ import {
4
+ Title,
5
+ Description,
6
+ Primary,
7
+ PRIMARY_STORY,
8
+ ArgsTable,
9
+ } from '@storybook/addon-docs/blocks';
10
+ import { siteSchema } from 'gatsby-core-theme/tests/factories/modules/site-schema.factory';
11
+ import ContactForm from '.';
12
+
13
+ const page = {};
14
+ siteSchema.email = [
15
+ { email: 'sales@irishluck.ie', contact_type: 'Sales Team' },
16
+ { email: 'support@irishluck.ie', contact_type: 'Support Team' },
17
+ { email: 'contact@irishluck.ie', contact_type: ' General Info' },
18
+ ];
19
+ page.siteSchema = { ...siteSchema };
20
+
21
+ export default {
22
+ title: 'Theme/Modules/Template Blocks/Site Contacts',
23
+ component: ContactForm,
24
+ argTypes: {
25
+ page: {
26
+ name: 'page',
27
+ type: { name: 'object', required: true },
28
+ defaultValue: '',
29
+ description: 'page object. Get emails list from site schema',
30
+ siteSchema: {
31
+ type: { summary: 'object' },
32
+ defaultValue: { summary: '' },
33
+ },
34
+ },
35
+ },
36
+ parameters: {
37
+ docs: {
38
+ description: {
39
+ component: 'A component that displays authors cards',
40
+ },
41
+ page: () => (
42
+ <>
43
+ <Title />
44
+ <Description />
45
+ <Primary />
46
+ <ArgsTable story={PRIMARY_STORY} />
47
+ </>
48
+ ),
49
+ },
50
+ },
51
+ };
52
+
53
+ const Template = (args) => <ContactForm {...args} />;
54
+ export const Default = Template.bind({});
55
+ Default.args = {
56
+ page,
57
+ };
@@ -0,0 +1,43 @@
1
+ /* eslint-disable camelcase */
2
+ import React from 'react';
3
+ import { render, cleanup } from '@testing-library/react';
4
+ import '@testing-library/jest-dom/extend-expect';
5
+ import { siteSchema } from 'gatsby-core-theme/tests/factories/modules/site-schema.factory';
6
+ import SiteContacts from '.';
7
+
8
+ const page = {};
9
+
10
+ beforeEach(() => {
11
+ siteSchema.email = [
12
+ { email: 'sales@irishluck.ie', contact_type: 'Sales Team' },
13
+ { email: 'support@irishluck.ie', contact_type: 'Support Team' },
14
+ { email: 'contact@irishluck.ie', contact_type: ' General Info' },
15
+ ];
16
+ page.siteSchema = { ...siteSchema };
17
+ });
18
+ describe('Site Contacts Component', () => {
19
+ test('render site contacts', () => {
20
+ const { container } = render(<SiteContacts page={page} />);
21
+ const { email } = siteSchema;
22
+
23
+ expect(container).toBeTruthy();
24
+ expect(container.querySelector('.generalContacts')).toBeTruthy();
25
+ expect(container.querySelectorAll('.generalContacts li')).toHaveLength(email.length);
26
+ expect(container.querySelector('.generalContacts li p')).toHaveTextContent(
27
+ email[0].contact_type
28
+ );
29
+ expect(container.querySelectorAll('.generalContacts li p')[1]).toHaveTextContent(
30
+ email[1].contact_type
31
+ );
32
+ expect(container.querySelectorAll('.generalContacts li a')[2]).toHaveAttribute(
33
+ 'href',
34
+ `mailto:${email[2].email}`
35
+ );
36
+ expect(container.querySelectorAll('.generalContacts li a')[0]).toHaveTextContent(
37
+ email[0].email
38
+ );
39
+ });
40
+ });
41
+ afterEach(() => {
42
+ cleanup();
43
+ });
@@ -1,33 +1,38 @@
1
1
  .container {
2
2
  width: 100%;
3
3
  @include flex-direction(column);
4
- .title{
5
- padding-bottom: 1.6rem;
6
- font-weight: 600;
7
- font-size: 1.6rem;
8
- line-height: 2.4rem;
9
- color: var(--color-33);
10
- @include min(tablet){
11
- font-weight: bold;
12
- font-size: 3.6rem;
13
- line-height: 4.6rem;
14
- }
4
+ }
5
+
6
+ .title{
7
+ padding-bottom: 1.6rem;
8
+ font-weight: 600;
9
+ font-size: 2.4rem;
10
+ line-height: 3.2rem;
11
+ color: #1b1b1c;
12
+
13
+ @include min(tablet){
14
+ font-weight: bold;
15
+ font-size: 3.2rem;
16
+ line-height: 4rem;
15
17
  }
16
- .socialIcons{
17
- display: inline-flex;
18
- a {
19
- display: inline-block;
20
- width: 4rem;
21
- height: 4rem;
22
- line-height: 4.7rem;
23
- border-radius: 50%;
24
- background: var(--color-52);
25
- margin: 0 1.6rem 0 0;
26
- text-align: center;
27
- font-size: 2rem;
28
- svg{
29
- color: #000;
30
- }
18
+ }
19
+
20
+ .socialIcons{
21
+ display: inline-flex;
22
+
23
+ a {
24
+ display: inline-block;
25
+ width: 4rem;
26
+ height: 4rem;
27
+ line-height: 4.7rem;
28
+ border-radius: 50%;
29
+ background: var(--color-52);
30
+ margin: 0 1.6rem 0 0;
31
+ text-align: center;
32
+ font-size: 2rem;
33
+
34
+ svg{
35
+ color: #000;
31
36
  }
32
37
  }
33
- }
38
+ }
@@ -10,7 +10,7 @@ import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
10
10
  import { Context } from 'gatsby-core-theme/src/context/MainProvider';
11
11
  import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating/one-star';
12
12
  import { FaStar } from '@react-icons/all-files/fa/FaStar';
13
- import Rating from '../../../../../atoms/rating';
13
+ import Rating from '../../../../../atoms/ratings';
14
14
  import OperatorBanner from '../../../../../atoms/header-operator-bannner';
15
15
  import styles from './template-four.module.scss';
16
16
 
@@ -10,7 +10,7 @@ import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
10
10
  import { Context } from 'gatsby-core-theme/src/context/MainProvider';
11
11
  import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating/one-star';
12
12
  import { FaStar } from '@react-icons/all-files/fa/FaStar';
13
- import Rating from '../../../../../atoms/rating';
13
+ import Rating from '../../../../../atoms/ratings';
14
14
  import OperatorBanner from '../../../../../atoms/header-operator-bannner';
15
15
 
16
16
  import styles from './template-one-two.module.scss';
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { prettyTracker, imagePrettyUrl, getAltText } from 'gatsby-core-theme/src/helpers/getters';
4
4
  import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
5
- import Rating from '../../../../../atoms/rating';
5
+ import Rating from '../../../../../atoms/ratings';
6
6
  import OperatorBanner from '../../../../../atoms/header-operator-bannner';
7
7
 
8
8
  import styles from './template-three.module.scss';