gatsby-matrix-theme 10.0.14 → 11.0.1
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.
- package/CHANGELOG.md +81 -0
- package/package.json +2 -2
- package/src/components/atoms/cards/comparison-table/table/index.js +2 -5
- package/src/components/atoms/cards/operator-card/index.js +2 -7
- package/src/components/atoms/cards/popup-card/index.js +4 -9
- package/src/components/atoms/ratings/index.js +54 -0
- package/src/components/atoms/ratings/ratings.module.scss +67 -0
- package/src/components/atoms/ratings/ratings.stories.js +25 -0
- package/src/components/atoms/ratings/ratings.test.js +38 -0
- package/src/components/atoms/tooltip/tooltip.test.js +4 -0
- package/src/components/molecules/header/variants/default/template-one/index.js +59 -0
- package/src/components/molecules/header/variants/default/template-one/template-one.module.scss +67 -0
- package/src/components/molecules/header/variants/default/template-one/template-one.stories.js +86 -0
- package/src/components/molecules/header/variants/default/template-one/template-one.test.js +80 -0
- package/src/components/molecules/header/variants/default/template-two/index.js +83 -0
- package/src/components/molecules/header/variants/default/template-two/template-two.module.scss +169 -0
- package/src/components/molecules/header/variants/default/template-two/template-two.stories.js +73 -0
- package/src/components/molecules/header/variants/default/template-two/template-two.test.js +94 -0
- package/src/components/molecules/header/variants/slot/template-one/index.js +86 -0
- package/src/components/molecules/header/variants/slot/template-one/slot.module.scss +115 -0
- package/src/components/molecules/header/variants/slot/template-one/template-one.stories.js +26 -0
- package/src/components/molecules/header/variants/slot/template-one/templateone.test.js +48 -0
- package/src/components/molecules/toplist/row/variant-one.js +6 -9
- package/src/gatsby-core-theme/components/molecules/header/header.module.scss +31 -38
- package/src/gatsby-core-theme/components/molecules/header/header.test.js +10 -17
- package/src/gatsby-core-theme/components/molecules/header/index.js +79 -28
- package/src/gatsby-core-theme/components/organisms/toplist/list/index.js +1 -1
- package/src/gatsby-core-theme/components/organisms/toplist/list/list.test.js +1 -0
- package/src/gatsby-core-theme/styles/utils/variables/_main.scss +2 -0
- package/storybook/public/64.5ed72561.iframe.bundle.js +1 -0
- package/storybook/public/673.194ef80c.iframe.bundle.js +7 -0
- package/storybook/public/{455.4a66b118.iframe.bundle.js.LICENSE.txt → 673.194ef80c.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook/public/{455.4a66b118.iframe.bundle.js.map → 673.194ef80c.iframe.bundle.js.map} +1 -1
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.dfab6b78.iframe.bundle.js +1 -0
- package/storybook/public/{runtime~main.66d840c7.iframe.bundle.js → runtime~main.f223f20e.iframe.bundle.js} +1 -1
- package/test/factories/pages/slot.js +59 -0
- package/tests/envVars.js +1 -0
- package/tests/factories/pages/default.factory.js +90 -0
- package/src/components/molecules/header/variants/slot/index.js +0 -12
- package/storybook/public/455.4a66b118.iframe.bundle.js +0 -7
- package/storybook/public/64.4e0c1a5c.iframe.bundle.js +0 -1
- package/storybook/public/main.eadbf337.iframe.bundle.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
|
1
|
+
## [11.0.1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v11.0.0...v11.0.1) (2023-01-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* adjusted justify-content ([d21f257](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d21f25791521339e98a2ad5d030d4af88f5725a4))
|
|
7
|
+
* remove margin-bottom ([b5ff383](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b5ff3839686ece26359dfd1a31430ec99bc4330d))
|
|
8
|
+
* small issues based on qa recom ([05838e1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/05838e1d67c07355490fe425c243e5345acdd099))
|
|
9
|
+
* update link on cards ([aeb91c7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/aeb91c727cf031f67f1b86e7844c6378567f38f6))
|
|
10
|
+
* update links on toplist and operator-card ([9c95bba](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9c95bba2b445c0b76cacc483107a86953a2f3594))
|
|
11
|
+
* update test ([1356596](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/1356596ca796d4013b424e072145996673726001))
|
|
12
|
+
* update the version of gatsby-core ([b75c4a7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b75c4a73ddf4a09af348d7c1820572284a0fbe77))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
* Merge branch 'tm-3138-changing-text-operator-review' into 'master' ([2753d66](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/2753d661da3041706e2220cfb552b98e303122d8))
|
|
16
|
+
* Merge branch 'tm-3254-game-header' into 'master' ([4b0e899](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4b0e899cf43c1244e180fe0c767093fee1157a57))
|
|
17
|
+
* Merge branch 'tm-3254-game-header' into 'master' ([5d35521](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5d35521cc0030d08b0eee4ba9cd6bad68fcd903b))
|
|
18
|
+
* Merge branch 'tm-3254-game-header' into 'master' ([3388067](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/3388067b942412684e9fc87ee4bedabbdda85d41))
|
|
19
|
+
|
|
20
|
+
# [11.0.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v10.0.14...v11.0.0) (2023-01-20)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* add max width for slots ([0d6f830](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0d6f830c3abdabf1e657c3cc491034533390857e))
|
|
26
|
+
* add padding to slotheader ([8b28ce6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8b28ce6e18be246c8db471afe4efb903a12b308a))
|
|
27
|
+
* add template one for slot/gaming ([e849f5e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e849f5ea685aa3d993a082256d6f9fd222d5e69f))
|
|
28
|
+
* added translations ([9f2c5e7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9f2c5e7d020dc54da27122ee9e726f379a6ce305))
|
|
29
|
+
* change svg and its size ([c134993](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/c134993a0ebbb3203c87483fcae13023f7c1b85b))
|
|
30
|
+
* clean up header section ([6cce914](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6cce914c78bdeb3a7bbdf30bfdd06a8ac65ca87d))
|
|
31
|
+
* remove typo ([10f94eb](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/10f94eb0db5eaab58bffaab6d4a2867f7858b640))
|
|
32
|
+
* show in the toplist just operator that has active status ([4d677bc](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4d677bc038cae31279822a6edfdfed309cc99d84))
|
|
33
|
+
* storybook folder structure names ([9a251dd](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9a251dd913bf90e4737289fa4e12b6ad0ad61cab))
|
|
34
|
+
* storybook structure and default colour ([96cb803](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/96cb803654daed0e413885e981c2d6e6ff806d0e))
|
|
35
|
+
* test coverage ([9859301](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/98593019552600fc990c645e291f41aa92104800))
|
|
36
|
+
* typo issue on header module ([ebfe10b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ebfe10b24e5db55deaf7da0651214fa3be3f4704))
|
|
37
|
+
* update changes and add story book and tests ([c8e522e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/c8e522e559ccabe2af97643da96c53a87a78327a))
|
|
38
|
+
* update header component scss ([095eba0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/095eba06dab2f22b8a1a1902a3e576c89484b466))
|
|
39
|
+
* update name storybook ([5093cd5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5093cd5cd1e4f5b3089146a86a8a9d0d98e8da21))
|
|
40
|
+
* update tests, removed console.logs and updated styling for ratings ([44aaa62](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/44aaa62425542896bc097a58725912c4c85059b1))
|
|
41
|
+
* updated project based on the requirements ([089dbad](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/089dbad6f50409d3e67a2dae18f70b8a99332ccf))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Code Refactoring
|
|
45
|
+
|
|
46
|
+
* add css vars for tem two bg colour ([4053130](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4053130a999d1a5205a81dcc63c9a9e3730a7465))
|
|
47
|
+
* add temp featured image ([7eaa990](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7eaa990e3bbebf6d86fb447242a670e2f645ae6a))
|
|
48
|
+
* add template based classes ([2737131](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/27371317510577af1cb85bcf7cdde79dda3a1c19))
|
|
49
|
+
* add two templates for default headers ([ed070cd](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ed070cd367bcf03fb43960addc4cd04becf6daca))
|
|
50
|
+
* change dummy link ([a96fca2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a96fca2578ea4583abbd2ca4ba70e5f16b6a48f0))
|
|
51
|
+
* change of scss ordering ([8794dbf](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8794dbf70865170a43f5a3d2138c25f32524571b))
|
|
52
|
+
* changes to field types ([eabc3e8](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/eabc3e893cb5fdee4d7987363d9869478753f8ff))
|
|
53
|
+
* correction to page type for default pages ([cd8aa25](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/cd8aa25141edfc9200057fa3b3bec9167e12c9b1))
|
|
54
|
+
* corrections to code review and remove images ([e4d3137](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e4d31370853cbdd2cb1bb0dd3977de2bb64ec934))
|
|
55
|
+
* fix for undefined classnames ([60306e9](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/60306e9631deceb3f061aafbfef4155e13ba2d98))
|
|
56
|
+
* fix mobile styles ([907f341](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/907f3419a3744a98cbd46c057e93a77699537e30))
|
|
57
|
+
* fix storybook properties and tests ([79f9858](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/79f9858581b60f70e24d72e5b65233f7bf146517))
|
|
58
|
+
* fix template one minor css issues ([5829ca2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5829ca2ab33899f0c4f9c03f7b14dc0ce60f63cb))
|
|
59
|
+
* image dimensions ([f8cc38e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/f8cc38e2f64b9fd6169fb04db20a6d637386b038))
|
|
60
|
+
* restructure header component ([7747c9d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7747c9da6e0b4d5f791ef191cb4bdf6785ada743))
|
|
61
|
+
* separate css ([7451e98](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7451e985b926e2c1d1f7a39acead52e7e3eeb019))
|
|
62
|
+
* storybook images ([fff47ea](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fff47ea3a6594143cbed2a6699f93917610285af))
|
|
63
|
+
* storybook layout change ([4add525](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4add525d95ae847dc0c995b0368518702f29e14f))
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
* Merge branch 'tm-3113-toplist' into 'master' ([8238beb](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8238beba9fd95d9adbc2d1295d1562573c06f239))
|
|
67
|
+
* Merge branch 'tm-3254-game-header' into 'master' ([b4d0d81](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b4d0d818fd80df7f95b0885917f5b5d9d2afadc4))
|
|
68
|
+
* Merge branch 'master' into 'tm-3254-game-header' ([b2f96c6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b2f96c666e5288f63a7f1c736da379bd123d7a4a))
|
|
69
|
+
* Merge branch 'tm-3252-default-headers' into 'master' ([9c313bd](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9c313bd53a7f34173e555712833444d3646ccb4e))
|
|
70
|
+
* Merge branch 'master' into tm-3252-default-headers ([d9ea393](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d9ea393cd598a2fe0a79d29b0b95341e6bc9f828))
|
|
71
|
+
* Merge branch 'master' into tm-3252-default-headers ([2c2960a](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/2c2960a1f3791b4742b8ac6e71c78ca8d27d60d3))
|
|
72
|
+
* Merge branch 'master' into tm-3252-default-headers ([30bdf57](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/30bdf577ac44e4229561297d54e153832c2ae0f2))
|
|
73
|
+
* Merge branch 'master' into tm-3252-default-headers ([9aebd17](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9aebd1771db338a99675ef3491e1577b145d8896))
|
|
74
|
+
* Merge branch 'master' into tm-3252-default-headers ([21582c7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/21582c7cbcfe08335b1ff45fd55265c1b5585cc5))
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### Tests
|
|
78
|
+
|
|
79
|
+
* fix test ([5076a8c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5076a8c42acfd194701d7e176b536f24312b4e1d))
|
|
80
|
+
* fix test scripts ([32ffbee](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/32ffbee13e6e421d9b7a9d8e1465d03a14c0f990))
|
|
81
|
+
|
|
1
82
|
## [10.0.14](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v10.0.13...v10.0.14) (2023-01-17)
|
|
2
83
|
|
|
3
84
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-matrix-theme",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.1",
|
|
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": "^4.20.0",
|
|
28
|
-
"gatsby-core-theme": "18.0.
|
|
28
|
+
"gatsby-core-theme": "18.0.3",
|
|
29
29
|
"gatsby-plugin-sharp": "^4.10.2",
|
|
30
30
|
"gatsby-plugin-sitemap": "^3.3.0",
|
|
31
31
|
"gatsby-transformer-sharp": "^4.10.0",
|
|
@@ -10,6 +10,7 @@ import { imagePrettyUrl, translate } from 'gatsby-core-theme/src/helpers/getters
|
|
|
10
10
|
import LazyImg from 'gatsby-core-theme/src/hooks/lazy-image';
|
|
11
11
|
import OperatorCta from 'gatsby-core-theme/src/components/atoms/operator-cta';
|
|
12
12
|
import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating/one-star';
|
|
13
|
+
import ReviewLink from 'gatsby-core-theme/src/components/atoms/review-link';
|
|
13
14
|
import Link from 'gatsby-core-theme/src/hooks/link';
|
|
14
15
|
import Bonus from 'gatsby-core-theme/src/components/atoms/bonus';
|
|
15
16
|
import { Context } from 'gatsby-core-theme/src/context/MainProvider';
|
|
@@ -116,11 +117,7 @@ export default function ComparisonTable({
|
|
|
116
117
|
<StarRating numOfStars={5} rating={item?.relation?.rating} />
|
|
117
118
|
|
|
118
119
|
{type === 'operator' && index === 0 ? null : (
|
|
119
|
-
<
|
|
120
|
-
translations,
|
|
121
|
-
'review',
|
|
122
|
-
'Review'
|
|
123
|
-
)}`}</Link>
|
|
120
|
+
<ReviewLink template={tempate} itemName={item.title} reviewPath={item.path} />
|
|
124
121
|
)}
|
|
125
122
|
</td>
|
|
126
123
|
);
|
|
@@ -7,6 +7,7 @@ import { getAltText, imagePrettyUrl, translate } from 'gatsby-core-theme/src/hel
|
|
|
7
7
|
import Link from 'gatsby-core-theme/src/hooks/link';
|
|
8
8
|
import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
|
|
9
9
|
import Bonus from 'gatsby-core-theme/src/components/atoms/bonus';
|
|
10
|
+
import ReviewLink from 'gatsby-core-theme/src/components/atoms/review-link';
|
|
10
11
|
import Tnc from 'gatsby-core-theme/src/components/molecules/tnc';
|
|
11
12
|
import { Context } from 'gatsby-core-theme/src/context/MainProvider';
|
|
12
13
|
import OperatorCta from 'gatsby-core-theme/src/components/atoms/operator-cta';
|
|
@@ -70,13 +71,7 @@ const OperatorCard = ({
|
|
|
70
71
|
backgroundImage && styles.hasBackground
|
|
71
72
|
}`}
|
|
72
73
|
>
|
|
73
|
-
<
|
|
74
|
-
to={reviewPath}
|
|
75
|
-
title={itemName}
|
|
76
|
-
className={`${styles.reviewLink} operator-card-gtm`}
|
|
77
|
-
>
|
|
78
|
-
{`${itemName} ${translate(translations, 'read_review', 'Review')}`}
|
|
79
|
-
</Link>
|
|
74
|
+
<ReviewLink template={page.template} itemName={itemName} reviewPath={reviewPath} />
|
|
80
75
|
<OperatorCta
|
|
81
76
|
tracker="main"
|
|
82
77
|
operator={relation}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { Context } from 'gatsby-core-theme/src/context/MainProvider';
|
|
5
4
|
import OperatorCta from 'gatsby-core-theme/src/components/atoms/operator-cta';
|
|
6
|
-
import { getAltText, imagePrettyUrl
|
|
5
|
+
import { getAltText, imagePrettyUrl } from 'gatsby-core-theme/src/helpers/getters';
|
|
6
|
+
import ReviewLink from 'gatsby-core-theme/src/components/atoms/review-link';
|
|
7
7
|
import Tnc from 'gatsby-core-theme/src/components/molecules/tnc';
|
|
8
8
|
import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating';
|
|
9
9
|
import Bonus from 'gatsby-core-theme/src/components/atoms/bonus';
|
|
10
10
|
import LazyImage from '~hooks/lazy-image';
|
|
11
|
-
import Link from '~hooks/link';
|
|
12
11
|
import styles from './popup-card.module.scss';
|
|
13
12
|
|
|
14
13
|
const PopupCard = ({
|
|
@@ -20,8 +19,6 @@ const PopupCard = ({
|
|
|
20
19
|
showReviewLink = false,
|
|
21
20
|
template,
|
|
22
21
|
}) => {
|
|
23
|
-
const { translations } = useContext(Context) || {};
|
|
24
|
-
|
|
25
22
|
const operatorName = item.name;
|
|
26
23
|
const oneLiner = item?.one_liners?.main?.one_liner;
|
|
27
24
|
const tnc = item?.extra_fields?.terms_and_conditions_text_enabled;
|
|
@@ -52,9 +49,7 @@ const PopupCard = ({
|
|
|
52
49
|
pageTemplate={template}
|
|
53
50
|
/>
|
|
54
51
|
{showReviewLink && (
|
|
55
|
-
<
|
|
56
|
-
{`${translate(translations, 'read_review', 'Read Review')}`}
|
|
57
|
-
</Link>
|
|
52
|
+
<ReviewLink template={template} itemName={item.name} reviewPath={item.review_link} />
|
|
58
53
|
)}
|
|
59
54
|
</div>
|
|
60
55
|
{showTnc && tnc === '1' && (
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
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
|
+
import { Context } from 'gatsby-core-theme/src/context/MainProvider';
|
|
7
|
+
import styles from './ratings.module.scss';
|
|
8
|
+
|
|
9
|
+
const Ratings = ({ averageRating, ratings, relation }) => {
|
|
10
|
+
const { translations } = useContext(Context) || {};
|
|
11
|
+
const votalityValue = relation?.volatility ? relation?.volatility : 0;
|
|
12
|
+
const rangeText = { 0: 'Low', 1: 'Medium', 2: 'High' }[votalityValue] || '0%';
|
|
13
|
+
|
|
14
|
+
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>
|
|
42
|
+
</ul>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
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,
|
|
52
|
+
}),
|
|
53
|
+
};
|
|
54
|
+
export default Ratings;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
.ratings {
|
|
2
|
+
display: flex;
|
|
3
|
+
margin: 0rem;
|
|
4
|
+
height: 100%;
|
|
5
|
+
gap: 0.8rem;
|
|
6
|
+
overflow-x: scroll;
|
|
7
|
+
@include min(tablet) {
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
gap: 1.6rem;
|
|
10
|
+
> :first-child {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
> li,
|
|
15
|
+
> div {
|
|
16
|
+
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 {
|
|
31
|
+
font-weight: 700;
|
|
32
|
+
font-size: 1.2rem;
|
|
33
|
+
line-height: 2rem;
|
|
34
|
+
color: #1c1a28;
|
|
35
|
+
@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
|
+
font-weight: 800;
|
|
52
|
+
font-size: 18px;
|
|
53
|
+
line-height: 28px;
|
|
54
|
+
}
|
|
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
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Ratings from '.';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Matrix-Theme/Atoms/Ratings',
|
|
7
|
+
component: Ratings,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Template = (args) => <Ratings {...args} />;
|
|
11
|
+
|
|
12
|
+
export const Default = Template.bind({});
|
|
13
|
+
Default.args = {
|
|
14
|
+
averageRating: 3,
|
|
15
|
+
ratings: [
|
|
16
|
+
{ field_name: 'first_rating', field_label: 'Graphics' },
|
|
17
|
+
{ field_name: 'third_rating', field_label: 'Bonuses' },
|
|
18
|
+
{ field_name: 'rtp', field_label: 'RTP' },
|
|
19
|
+
],
|
|
20
|
+
relation: {
|
|
21
|
+
first_rating: 2,
|
|
22
|
+
third_rating: 3,
|
|
23
|
+
rtp: 50,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, cleanup } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
4
|
+
|
|
5
|
+
import getPageData from '../../../../test/factories/pages/slot';
|
|
6
|
+
import Ratings from '.';
|
|
7
|
+
|
|
8
|
+
describe('summary component', () => {
|
|
9
|
+
test('render', () => {
|
|
10
|
+
const { container } = render(<Ratings page={getPageData()} />);
|
|
11
|
+
expect(container).toBeTruthy();
|
|
12
|
+
|
|
13
|
+
// Description
|
|
14
|
+
expect(container.querySelectorAll('ul.ratings')).toHaveLength(1);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('renders the correct ratings', () => {
|
|
18
|
+
const averageRating = 4.5;
|
|
19
|
+
const ratings = [
|
|
20
|
+
{ field_label: 'Graphics', field_name: 'graphics', value: 4.2 },
|
|
21
|
+
{ field_label: 'Sound', field_name: 'sound', value: 5 },
|
|
22
|
+
];
|
|
23
|
+
const relation = { graphics: 4.2, sound: 5 };
|
|
24
|
+
const { getByText, getByTestId } = render(
|
|
25
|
+
<Ratings averageRating={averageRating} ratings={ratings} relation={relation} />
|
|
26
|
+
);
|
|
27
|
+
const overallRating = getByTestId('overall-rating');
|
|
28
|
+
const graphicsRating = getByText(`${relation.graphics}/`);
|
|
29
|
+
const soundRating = getByText(`${relation.sound}/`);
|
|
30
|
+
expect(overallRating).toBeInTheDocument();
|
|
31
|
+
expect(graphicsRating).toBeInTheDocument();
|
|
32
|
+
expect(soundRating).toBeInTheDocument();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
afterEach(() => {
|
|
37
|
+
cleanup();
|
|
38
|
+
});
|
|
@@ -16,5 +16,9 @@ describe('Tooltip Component', () => {
|
|
|
16
16
|
|
|
17
17
|
fireEvent.mouseEnter(screen.getByText('Test Children'));
|
|
18
18
|
await waitFor(() => screen.getByText('test content'));
|
|
19
|
+
|
|
20
|
+
fireEvent.mouseLeave(screen.getByText('Test Children'));
|
|
21
|
+
const isVisible = container.querySelector('.tooltip');
|
|
22
|
+
expect(isVisible).toBeFalsy();
|
|
19
23
|
});
|
|
20
24
|
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
|
|
4
|
+
import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
|
|
5
|
+
import Button from 'gatsby-core-theme/src/components/atoms/button';
|
|
6
|
+
import { imagePrettyUrl, getAltText, getExtraField } from 'gatsby-core-theme/src/helpers/getters';
|
|
7
|
+
import styles from './template-one.module.scss';
|
|
8
|
+
|
|
9
|
+
export default function TemplateOne({ title, description, extraFields, imageObj }) {
|
|
10
|
+
const link = getExtraField(extraFields, 'link');
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div className={styles.templateOne}>
|
|
14
|
+
<div className={styles.headerContainer}>
|
|
15
|
+
<h1>{title}</h1>
|
|
16
|
+
<div
|
|
17
|
+
// eslint-disable-next-line react/no-danger
|
|
18
|
+
dangerouslySetInnerHTML={{ __html: description }}
|
|
19
|
+
className={styles.description}
|
|
20
|
+
/>
|
|
21
|
+
{link && (
|
|
22
|
+
<Button
|
|
23
|
+
to={link}
|
|
24
|
+
primaryColor={false}
|
|
25
|
+
btnText={link}
|
|
26
|
+
invertColors
|
|
27
|
+
gtmClass="default-header-template-one-gtm btn-cta"
|
|
28
|
+
icon={<FaArrowRight />}
|
|
29
|
+
/>
|
|
30
|
+
)}
|
|
31
|
+
</div>
|
|
32
|
+
{imageObj && (
|
|
33
|
+
<LazyImage
|
|
34
|
+
src={imagePrettyUrl(imageObj.filename, imageObj.width, imageObj.height)}
|
|
35
|
+
alt={getAltText(imageObj, imageObj.title)}
|
|
36
|
+
width={imageObj.width}
|
|
37
|
+
height={imageObj.height}
|
|
38
|
+
loading="eager"
|
|
39
|
+
className={styles.image}
|
|
40
|
+
/>
|
|
41
|
+
)}
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
TemplateOne.propTypes = {
|
|
47
|
+
title: PropTypes.string,
|
|
48
|
+
description: PropTypes.string,
|
|
49
|
+
imageObj: PropTypes.shape({
|
|
50
|
+
alt: PropTypes.string,
|
|
51
|
+
width: PropTypes.string,
|
|
52
|
+
height: PropTypes.string,
|
|
53
|
+
filename: PropTypes.string,
|
|
54
|
+
title: PropTypes.string,
|
|
55
|
+
}),
|
|
56
|
+
extraFields: PropTypes.shape({
|
|
57
|
+
link: PropTypes.string,
|
|
58
|
+
}),
|
|
59
|
+
};
|
package/src/components/molecules/header/variants/default/template-one/template-one.module.scss
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
.templateOne {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
flex-direction: column-reverse;
|
|
6
|
+
gap: 2.4rem;
|
|
7
|
+
padding: 0 1.6rem;
|
|
8
|
+
max-width: var(--main-container-max);
|
|
9
|
+
margin: 0 auto;
|
|
10
|
+
|
|
11
|
+
@include min(tablet) {
|
|
12
|
+
flex-direction: row;
|
|
13
|
+
gap: 5rem;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@include min(desktop) {
|
|
17
|
+
gap: 15.2rem;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.image {
|
|
22
|
+
border-radius: 1.6rem;
|
|
23
|
+
|
|
24
|
+
@include min(tablet) {
|
|
25
|
+
max-width: 50%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@include min(laptop) {
|
|
29
|
+
min-width: 35.6rem;
|
|
30
|
+
max-width: 35.6rem;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.headerContainer {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: flex-start;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
|
|
40
|
+
h1 {
|
|
41
|
+
font-weight: 700;
|
|
42
|
+
font-size: 2.8rem;
|
|
43
|
+
line-height: 3.8rem;
|
|
44
|
+
text-transform: capitalize;
|
|
45
|
+
color: #1c1a28;
|
|
46
|
+
margin: 0 0 2.4rem;
|
|
47
|
+
|
|
48
|
+
@include min(tablet) {
|
|
49
|
+
font-size: 3.2rem;
|
|
50
|
+
line-height: 4.2rem;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
a {
|
|
55
|
+
display: flex !important;
|
|
56
|
+
gap: 1.1rem;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.description {
|
|
61
|
+
font-weight: 500;
|
|
62
|
+
font-size: 1.6rem;
|
|
63
|
+
line-height: 2.7rem;
|
|
64
|
+
text-align: justify;
|
|
65
|
+
color: #3e3c47;
|
|
66
|
+
padding-bottom: 2.4rem;
|
|
67
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
Title,
|
|
5
|
+
Description,
|
|
6
|
+
Primary,
|
|
7
|
+
PRIMARY_STORY,
|
|
8
|
+
ArgsTable,
|
|
9
|
+
} from '@storybook/addon-docs/blocks';
|
|
10
|
+
import MainProvider from '~context/MainProvider';
|
|
11
|
+
import getPageData from '../../../../../../../tests/factories/pages/default.factory';
|
|
12
|
+
import TemplateOne from '.';
|
|
13
|
+
|
|
14
|
+
const pageData = getPageData();
|
|
15
|
+
pageData.featured_image_object = {
|
|
16
|
+
alt: null,
|
|
17
|
+
filename: '1673344017/456x343px.png',
|
|
18
|
+
height: '343',
|
|
19
|
+
title: '456x343px',
|
|
20
|
+
url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1673344017/456x343px.png',
|
|
21
|
+
width: '456',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
title: 'Matrix-Theme/Layout/Header/Default/Template One',
|
|
26
|
+
component: TemplateOne,
|
|
27
|
+
argTypes: {
|
|
28
|
+
title: {
|
|
29
|
+
title: 'Title',
|
|
30
|
+
type: { name: 'string', required: true },
|
|
31
|
+
defaultValue: pageData.title,
|
|
32
|
+
description: 'page title',
|
|
33
|
+
},
|
|
34
|
+
description: {
|
|
35
|
+
name: 'Description',
|
|
36
|
+
type: { name: 'string', required: true },
|
|
37
|
+
defaultValue: pageData.description,
|
|
38
|
+
description: 'page description',
|
|
39
|
+
},
|
|
40
|
+
extraFields: {
|
|
41
|
+
name: 'Extra Fields',
|
|
42
|
+
type: { name: 'object', required: true },
|
|
43
|
+
defaultValue: pageData?.extra_fields,
|
|
44
|
+
description: 'page link/CTA',
|
|
45
|
+
},
|
|
46
|
+
imageObj: {
|
|
47
|
+
name: 'Featured image',
|
|
48
|
+
type: { name: 'object', required: true },
|
|
49
|
+
defaultValue: pageData?.featured_image_object,
|
|
50
|
+
description: 'page featured image',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
parameters: {
|
|
54
|
+
docs: {
|
|
55
|
+
description: {
|
|
56
|
+
component: 'A Default Header Component - Template two',
|
|
57
|
+
},
|
|
58
|
+
page: () => (
|
|
59
|
+
<>
|
|
60
|
+
<Title />
|
|
61
|
+
<Description />
|
|
62
|
+
<Primary />
|
|
63
|
+
<ArgsTable story={PRIMARY_STORY} />
|
|
64
|
+
</>
|
|
65
|
+
),
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const Template = (args) => (
|
|
71
|
+
<MainProvider
|
|
72
|
+
value={{
|
|
73
|
+
bannerIsActive: false,
|
|
74
|
+
cookieAccepted: true,
|
|
75
|
+
translations: {
|
|
76
|
+
online_casino: 'Online Casino',
|
|
77
|
+
},
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
<div>
|
|
81
|
+
<TemplateOne {...args} />
|
|
82
|
+
</div>
|
|
83
|
+
</MainProvider>
|
|
84
|
+
);
|
|
85
|
+
export const Default = Template.bind({});
|
|
86
|
+
Default.args = {};
|