gatsby-matrix-theme 53.0.31 → 53.1.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 (50) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/package.json +2 -2
  3. package/src/components/atoms/author-card/index.js +3 -2
  4. package/src/components/atoms/cards/article-card/variables/index.js +11 -9
  5. package/src/components/atoms/cards/author/template-one/index.js +3 -1
  6. package/src/components/atoms/cards/author/template-two/index.js +2 -1
  7. package/src/components/atoms/cards/game-cards/template-five/index.js +10 -10
  8. package/src/components/atoms/cards/game-cards/template-four/index.js +9 -9
  9. package/src/components/atoms/cards/game-cards/template-one/index.js +9 -9
  10. package/src/components/atoms/cards/game-cards/template-three/index.js +10 -10
  11. package/src/components/atoms/cards/game-cards/template-two/index.js +10 -10
  12. package/src/components/atoms/cards/payment-method/template-one/index.js +6 -5
  13. package/src/components/atoms/cards/payment-method/template-three/index.js +7 -6
  14. package/src/components/atoms/cards/popup-card/index.js +7 -6
  15. package/src/components/atoms/cards/software-provider-card/index.js +4 -3
  16. package/src/components/atoms/feedback/template-three/index.js +7 -7
  17. package/src/components/atoms/feedback/template-two/index.js +4 -3
  18. package/src/components/atoms/ratings-with-comments/index.js +133 -0
  19. package/src/components/atoms/ratings-with-comments/ratings-with-comments.module.scss +300 -0
  20. package/src/components/molecules/header/variants/author/assets/portrait/index.js +2 -1
  21. package/src/components/molecules/header/variants/default/template-two/index.js +5 -5
  22. package/src/components/molecules/header/variants/operator/template-five/index.js +7 -6
  23. package/src/components/molecules/header/variants/operator/template-four/index.js +7 -6
  24. package/src/components/molecules/header/variants/operator/template-three/index.js +6 -5
  25. package/src/components/molecules/header/variants/payment/template-five/index.js +6 -5
  26. package/src/components/molecules/header/variants/payment/template-four/index.js +5 -4
  27. package/src/components/molecules/header/variants/payment/template-one-three/index.js +6 -5
  28. package/src/components/molecules/header/variants/payment/template-two/index.js +5 -4
  29. package/src/components/molecules/header/variants/slot/template-one/index.js +4 -3
  30. package/src/components/molecules/header/variants/slot/template-two/index.js +6 -5
  31. package/src/components/molecules/operator-details/index.js +8 -7
  32. package/src/components/molecules/operator-exclusive/index.js +5 -4
  33. package/src/gatsby-core-theme/components/molecules/module/index.js +2 -0
  34. package/src/gatsby-core-theme/components/molecules/star-rating/linear-rating.js +56 -0
  35. package/src/gatsby-core-theme/components/molecules/star-rating/linear-rating.module.scss +43 -0
  36. package/storybook/public/{232.72a14466.iframe.bundle.js → 232.e2508c7f.iframe.bundle.js} +1 -1
  37. package/storybook/public/582.f442a86e.iframe.bundle.js +1 -0
  38. package/storybook/public/679.144f0a65.iframe.bundle.js +1 -0
  39. package/storybook/public/{912.6f6e8178.iframe.bundle.js → 717.420d37ed.iframe.bundle.js} +4 -4
  40. package/storybook/public/{912.6f6e8178.iframe.bundle.js.map → 717.420d37ed.iframe.bundle.js.map} +1 -1
  41. package/storybook/public/941.a249aa66.iframe.bundle.js +1 -0
  42. package/storybook/public/iframe.html +1 -1
  43. package/storybook/public/main.58ab21ce.iframe.bundle.js +1 -0
  44. package/storybook/public/project.json +1 -1
  45. package/storybook/public/runtime~main.ab877657.iframe.bundle.js +1 -0
  46. package/storybook/public/679.4fbb874f.iframe.bundle.js +0 -1
  47. package/storybook/public/909.b439deb7.iframe.bundle.js +0 -1
  48. package/storybook/public/main.fcc4bb69.iframe.bundle.js +0 -1
  49. package/storybook/public/runtime~main.40bd7856.iframe.bundle.js +0 -1
  50. /package/storybook/public/{912.6f6e8178.iframe.bundle.js.LICENSE.txt → 717.420d37ed.iframe.bundle.js.LICENSE.txt} +0 -0
@@ -0,0 +1,300 @@
1
+ /* stylelint-disable comment-pattern, selector-max-compound-selectors, max-nesting-depth */
2
+ .ratingsContainer {
3
+ display: flex;
4
+ box-shadow: 0 4px 6px -2px #1b1b1c0a, 0 12px 16px -4px #1b1b1c12;
5
+ padding: 1.6rem;
6
+ background: #fff;
7
+ border-radius: 0.8rem;
8
+ gap: 1.7rem;
9
+ flex-direction: column;
10
+
11
+ @include min(laptop) {
12
+ flex-direction: row;
13
+ }
14
+
15
+ > li {
16
+ background: #f1f5f9;
17
+ padding: 1.6rem 0.8rem;
18
+ border-radius: 0.8rem;
19
+ display: flex;
20
+ flex-flow: row-reverse wrap;
21
+ justify-content: center;
22
+ min-width: 11.4rem;
23
+ gap: 0.8rem;
24
+ min-height: 7.2rem;
25
+ align-items: center;
26
+
27
+ @include min(laptop) {
28
+ flex-direction: column-reverse;
29
+ min-height: 14.2rem;
30
+ }
31
+
32
+ > div {
33
+ @include flex-direction(row);
34
+
35
+ align-items: center;
36
+ gap: 0.8rem;
37
+
38
+ @include min(laptop) {
39
+ @include flex-direction(column);
40
+ }
41
+ }
42
+
43
+ > p {
44
+ font-size: 1.4rem;
45
+ line-height: 2.2rem;
46
+ font-weight: 600;
47
+ color: #0f172a;
48
+ }
49
+ }
50
+ }
51
+
52
+ .ratingList {
53
+ display: grid;
54
+ grid-template-rows: repeat(3, 1fr);
55
+ width: 100%;
56
+ gap: 1.6rem 2.2rem;
57
+ background: #f1f5f9;
58
+ border-radius: 1.6rem;
59
+ padding: 1.6rem;
60
+
61
+ @include min(laptop) {
62
+ grid-template-columns: 1fr 1fr;
63
+ }
64
+ }
65
+
66
+ .item {
67
+ display: grid;
68
+ position: relative;
69
+
70
+ @include min(laptop) {
71
+ grid-template-columns: 1fr 1fr;
72
+ align-items: center;
73
+ }
74
+ }
75
+
76
+ .label {
77
+ color: #0f172a;
78
+ font-size: 1.4rem;
79
+ line-height: 2.2rem;
80
+ font-weight: 600;
81
+ }
82
+
83
+ .value {
84
+ font-weight: 700;
85
+ font-size: 18px;
86
+ line-height: 28px;
87
+ color: #1c1a28;
88
+ display: flex;
89
+
90
+ @include min(tablet) {
91
+ font-weight: 800;
92
+ }
93
+ }
94
+
95
+ .showOnlyMobile {
96
+ border: 1.5px solid #d63b54;
97
+ }
98
+
99
+ .ratingWithBoxes {
100
+ background: transparent;
101
+ padding: 0;
102
+ overflow-y: auto;
103
+ padding-bottom: 1.6rem;
104
+
105
+ &::-webkit-scrollbar {
106
+ height: 0.5rem;
107
+ }
108
+
109
+ &::-webkit-scrollbar-track {
110
+ background: #5b8bb933;
111
+ border-radius: 1rem;
112
+ }
113
+
114
+ &::-webkit-scrollbar-thumb {
115
+ background-color: #cbd5e1;
116
+ border-radius: 1rem;
117
+ }
118
+
119
+ @include min(tablet) {
120
+ padding-bottom: 0;
121
+ }
122
+
123
+ > ul {
124
+ background: transparent;
125
+ display: flex;
126
+ padding: 0;
127
+ gap: 0.8rem;
128
+
129
+ @include min(tablet) {
130
+ gap: 1.6rem;
131
+ }
132
+
133
+ > li {
134
+ display: flex;
135
+ flex-direction: column;
136
+ width: 100%;
137
+ gap: 0.8rem;
138
+ min-height: 9.6rem;
139
+ background: #f4f4f4;
140
+ border-radius: 0.8rem;
141
+ padding: 2.2rem;
142
+ color: #1b1b1c;
143
+ font-weight: 600;
144
+ font-size: 1.4rem;
145
+ line-height: 2.2rem;
146
+ // min-width: 13.6rem;
147
+ text-align: center;
148
+ align-items: center;
149
+ justify-content: center;
150
+ white-space: nowrap;
151
+
152
+ @include min(tablet) {
153
+ white-space: normal;
154
+ }
155
+
156
+ > p {
157
+ font-size: 1.4rem;
158
+ line-height: 2.2rem;
159
+ font-weight: 500;
160
+ color: #3c3c40;
161
+ min-width: 98px;
162
+ }
163
+ }
164
+ }
165
+ }
166
+
167
+ .withTitle {
168
+ @include flex-direction(column);
169
+
170
+ gap: 1.6rem;
171
+
172
+ @include min(tablet) {
173
+ justify-content: space-between;
174
+
175
+ @include flex-direction(row);
176
+ }
177
+
178
+ h3 {
179
+ margin: 0;
180
+ font-size: 2.4rem;
181
+ color: #000;
182
+ line-height: 4rem;
183
+ font-weight: 600;
184
+ }
185
+
186
+ > li {
187
+ display: flex;
188
+ justify-content: space-between;
189
+ gap: 1.8rem;
190
+
191
+ @include min(tablet) {
192
+ gap: 1.5rem;
193
+ }
194
+
195
+ > p {
196
+ color: #000;
197
+ font-size: 1.8rem;
198
+ line-height: 2.8rem;
199
+ font-weight: 600;
200
+ }
201
+
202
+ > div {
203
+ gap: 1.5rem;
204
+ display: flex;
205
+
206
+ @include min(tablet) {
207
+ display: inherit;
208
+ }
209
+
210
+ > div:first-child {
211
+ background: #fff;
212
+ margin: 1rem 0;
213
+ border-radius: 0.8rem;
214
+
215
+ > div {
216
+ background: #59be28;
217
+ border-radius: 0.8rem;
218
+ }
219
+ }
220
+
221
+ > div:last-child {
222
+ display: flex;
223
+ align-items: center;
224
+ position: static;
225
+
226
+ > svg {
227
+ margin-right: 1.5rem;
228
+ }
229
+ }
230
+ }
231
+ }
232
+ }
233
+
234
+ .ratingsWithComments {
235
+ flex-direction: column;
236
+ padding: 0;
237
+ box-shadow: none;
238
+
239
+ @include min(tablet) {
240
+ padding: inherit;
241
+ }
242
+
243
+ > ul {
244
+ gap: 1.6rem;
245
+
246
+ @include min(tablet) {
247
+ row-gap: 3.2rem;
248
+ }
249
+
250
+ > li {
251
+ @include flex-direction(column);
252
+
253
+ align-items: flex-start;
254
+
255
+ > p {
256
+ font-size: 2rem;
257
+ line-height: 3.6rem;
258
+ color: #000;
259
+ font-weight: 600;
260
+ margin-bottom: 0.8rem;
261
+ }
262
+
263
+ > span {
264
+ grid-column: 1 / 3;
265
+ font-size: 1.6rem;
266
+ line-height: 2.6rem;
267
+ color: #000;
268
+ }
269
+
270
+ > div {
271
+ min-width: 100%;
272
+ grid-template-columns: 8fr auto;
273
+ gap: 2rem;
274
+
275
+ > div:first-child {
276
+ background: #fff;
277
+ margin: 1rem 0;
278
+ border-radius: 0.8rem;
279
+
280
+ > div {
281
+ background: #59be28;
282
+ border-radius: 0.8rem;
283
+ }
284
+ }
285
+
286
+ > div:last-child {
287
+ font-size: 1.8rem;
288
+ line-height: 2.8rem;
289
+ color: #000;
290
+ display: flex;
291
+ align-items: center;
292
+
293
+ svg {
294
+ margin-right: 0.8rem;
295
+ }
296
+ }
297
+ }
298
+ }
299
+ }
300
+ }
@@ -2,7 +2,8 @@
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import LazyImage from '~hooks/lazy-image';
5
- import { imagePrettyUrl, getAltText } from '~helpers/getters';
5
+ import { imagePrettyUrl } from '~helpers/getters';
6
+ import { getAltText } from '~helpers/image';
6
7
  import styles from './portrait.module.scss';
7
8
 
8
9
  export default function Portrait({ className = '', author, width = 180, height = 180 }) {
@@ -1,15 +1,15 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
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/button';
4
+ import LazyImage from '~hooks/lazy-image';
5
+ import Button from '~atoms/button/button';
6
6
  import {
7
7
  imagePrettyUrl,
8
- getAltText,
9
8
  getBonus,
10
9
  getExtraField,
11
- } from 'gatsby-core-theme/src/helpers/getters';
12
- import Tnc from 'gatsby-core-theme/src/components/molecules/tnc';
10
+ } from '~helpers/getters';
11
+ import { getAltText } from '~helpers/image';
12
+ import Tnc from '~molecules/tnc';
13
13
  import useTranslate from '~hooks/useTranslate/useTranslate';
14
14
  import styles from './template-two.module.scss';
15
15
 
@@ -1,12 +1,13 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { imagePrettyUrl, getAltText, getObjectValue } from 'gatsby-core-theme/src/helpers/getters';
4
- import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
5
- import OneStar from 'gatsby-core-theme/src/components/molecules/star-rating/one-star';
6
- import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating';
7
3
  import { FaStar } from '@react-icons/all-files/fa/FaStar';
8
- import OperatorBanner from 'gatsby-core-theme/src/components/atoms/header-operator-bannner';
9
- import { operatorRatings } from 'gatsby-core-theme/src/constants/ratings-constant';
4
+ import { imagePrettyUrl, getObjectValue } from '~helpers/getters';
5
+ import { getAltText } from '~helpers/image';
6
+ import LazyImage from '~hooks/lazy-image';
7
+ import OneStar from '~molecules/star-rating/one-star';
8
+ import StarRating from '~molecules/star-rating';
9
+ import OperatorBanner from '~atoms/header-operator-bannner';
10
+ import { operatorRatings } from '~constants/ratings-constant';
10
11
  import useTranslate from '~hooks/useTranslate/useTranslate';
11
12
  import { TrackingKeys } from '~constants/tracking-api'
12
13
  import Verify from '~images/icons/verify';
@@ -1,13 +1,14 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  // eslint-disable-next-line import/no-extraneous-dependencies
4
- import { imagePrettyUrl, getAltText } from 'gatsby-core-theme/src/helpers/getters';
5
- import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
6
- import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating/one-star';
7
4
  import { FaStar } from '@react-icons/all-files/fa/FaStar';
8
- import OperatorBanner from 'gatsby-core-theme/src/components/atoms/header-operator-bannner';
9
- import Ribbon from 'gatsby-core-theme/src/components/atoms/ribbons';
10
- import Rating from 'gatsby-core-theme/src/components/atoms/ratings';
5
+ import { imagePrettyUrl } from '~helpers/getters';
6
+ import { getAltText } from '~helpers/image';
7
+ import LazyImage from '~hooks/lazy-image';
8
+ import StarRating from '~molecules/star-rating/one-star';
9
+ import OperatorBanner from '~atoms/header-operator-bannner';
10
+ import Ribbon from '~atoms/ribbons';
11
+ import Rating from '~atoms/ratings';
11
12
  import useTranslate from '~hooks/useTranslate/useTranslate';
12
13
  import Verify from '~images/icons/verify';
13
14
  import VariableComponent from '../variables';
@@ -1,11 +1,12 @@
1
1
  /* eslint-disable import/no-extraneous-dependencies */
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { imagePrettyUrl, getAltText } from 'gatsby-core-theme/src/helpers/getters';
5
- import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
6
- import Rating from 'gatsby-core-theme/src/components/atoms/ratings';
7
- import OperatorBanner from 'gatsby-core-theme/src/components/atoms/header-operator-bannner';
8
- import Ribbons from 'gatsby-core-theme/src/components/atoms/ribbons';
4
+ import { imagePrettyUrl } from '~helpers/getters';
5
+ import { getAltText } from '~helpers/image';
6
+ import LazyImage from '~hooks/lazy-image';
7
+ import Rating from '~atoms/ratings';
8
+ import OperatorBanner from '~atoms/header-operator-bannner';
9
+ import Ribbons from '~atoms/ribbons';
9
10
  import Verify from '~images/icons/verify';
10
11
  import VariableComponent from '../variables';
11
12
  import { TrackingKeys } from '~constants/tracking-api'
@@ -1,11 +1,12 @@
1
1
  /* eslint-disable react/no-danger */
2
2
  import React, { useState, useRef } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { imagePrettyUrl, getAltText, textWordsLimit } from 'gatsby-core-theme/src/helpers/getters';
5
- import Tnc from 'gatsby-core-theme/src/components/molecules/tnc';
6
- import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
7
- import OperatorBanner from 'gatsby-core-theme/src/components/atoms/header-operator-bannner';
8
- import Rating from 'gatsby-core-theme/src/components/atoms/ratings';
4
+ import { imagePrettyUrl, textWordsLimit } from '~helpers/getters';
5
+ import { getAltText } from '~helpers/image';
6
+ import Tnc from '~molecules/tnc';
7
+ import LazyImage from '~hooks/lazy-image';
8
+ import OperatorBanner from '~atoms/header-operator-bannner';
9
+ import Rating from '~atoms/ratings';
9
10
  import useTranslate from '~hooks/useTranslate/useTranslate';
10
11
  import { TrackingKeys } from '~constants/tracking-api'
11
12
  import Verify from '~images/icons/verify';
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { imagePrettyUrl, getAltText } from 'gatsby-core-theme/src/helpers/getters';
4
- import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
5
- import Rating from 'gatsby-core-theme/src/components/atoms/ratings';
6
- import OperatorBanner from 'gatsby-core-theme/src/components/atoms/header-operator-bannner';
3
+ import { imagePrettyUrl } from '~helpers/getters';
4
+ import { getAltText } from '~helpers/image';
5
+ import LazyImage from '~hooks/lazy-image';
6
+ import Rating from '~atoms/ratings';
7
+ import OperatorBanner from '~atoms/header-operator-bannner';
7
8
  import Verify from '~images/icons/verify';
8
9
  import { TrackingKeys } from '~constants/tracking-api'
9
10
  import styles from './template-four.module.scss';
@@ -1,12 +1,13 @@
1
1
  /* eslint-disable react/no-danger */
2
2
  import React, { useState, useRef } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { imagePrettyUrl, getAltText, textWordsLimit } from 'gatsby-core-theme/src/helpers/getters';
5
- import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
6
- import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating/one-star';
7
4
  import { FaStar } from '@react-icons/all-files/fa/FaStar';
8
- import OperatorBanner from 'gatsby-core-theme/src/components/atoms/header-operator-bannner';
9
- import Rating from 'gatsby-core-theme/src/components/atoms/ratings';
5
+ import { imagePrettyUrl, textWordsLimit } from '~helpers/getters';
6
+ import { getAltText } from '~helpers/image';
7
+ import LazyImage from '~hooks/lazy-image';
8
+ import StarRating from '~molecules/star-rating/one-star';
9
+ import OperatorBanner from '~atoms/header-operator-bannner';
10
+ import Rating from '~atoms/ratings';
10
11
  import useTranslate from '~hooks/useTranslate/useTranslate';
11
12
  import { TrackingKeys } from '~constants/tracking-api'
12
13
  import Verify from '~images/icons/verify';
@@ -1,11 +1,12 @@
1
1
  /* eslint-disable react/no-danger */
2
2
  import React, { useState, useRef } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { imagePrettyUrl, getAltText, textWordsLimit } from 'gatsby-core-theme/src/helpers/getters';
5
- import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
6
- import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating/one-star';
7
4
  import { FaStar } from '@react-icons/all-files/fa/FaStar';
8
- import OperatorBanner from 'gatsby-core-theme/src/components/atoms/header-operator-bannner';
5
+ import { getAltText } from '~helpers/image';
6
+ import { imagePrettyUrl, textWordsLimit } from '~helpers/getters';
7
+ import LazyImage from '~hooks/lazy-image';
8
+ import StarRating from '~molecules/star-rating/one-star';
9
+ import OperatorBanner from '~atoms/header-operator-bannner';
9
10
  import useTranslate from '~hooks/useTranslate/useTranslate';
10
11
  import { TrackingKeys } from '~constants/tracking-api'
11
12
 
@@ -2,9 +2,10 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
4
  import { FaStar } from '@react-icons/all-files/fa/FaStar';
5
- import { imagePrettyUrl, getAltText } from 'gatsby-core-theme/src/helpers/getters';
6
- import OperatorBanner from 'gatsby-core-theme/src/components/atoms/header-operator-bannner';
7
- import Rating from 'gatsby-core-theme/src/components/atoms/ratings';
5
+ import { imagePrettyUrl } from '~helpers/getters';
6
+ import { getAltText } from '~helpers/image';
7
+ import OperatorBanner from '~atoms/header-operator-bannner';
8
+ import Rating from '~atoms/ratings';
8
9
  import Verify from '~images/icons/verify';
9
10
  import { TrackingKeys } from '~constants/tracking-api'
10
11
 
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
- import { imagePrettyUrl, getAltText } from 'gatsby-core-theme/src/helpers/getters';
5
- import Tnc from 'gatsby-core-theme/src/components/molecules/tnc';
6
- import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
7
- import OperatorBanner from 'gatsby-core-theme/src/components/atoms/header-operator-bannner';
8
- import Rating from 'gatsby-core-theme/src/components/atoms/ratings';
4
+ import { imagePrettyUrl } from '~helpers/getters';
5
+ import { getAltText } from '~helpers/image';
6
+ import Tnc from '~molecules/tnc';
7
+ import LazyImage from '~hooks/lazy-image';
8
+ import OperatorBanner from '~atoms/header-operator-bannner';
9
+ import Rating from '~atoms/ratings';
9
10
  import useTranslate from '~hooks/useTranslate/useTranslate';
10
11
  import Verify from '~images/icons/verify';
11
12
  import { TrackingKeys } from '~constants/tracking-api'
@@ -1,13 +1,14 @@
1
1
  /* eslint-disable import/no-extraneous-dependencies */
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
5
- import Link from 'gatsby-core-theme/src/hooks/link';
6
- import { imagePrettyUrl, getAltText } from 'gatsby-core-theme/src/helpers/getters';
7
- import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating/one-star';
8
- import MultiStarRating from 'gatsby-core-theme/src/components/molecules/star-rating/';
9
- import ReviewLink from 'gatsby-core-theme/src/components/atoms/review-link';
10
- import Ribbons from 'gatsby-core-theme/src/components/atoms/ribbons';
4
+ import LazyImage from '~hooks/lazy-image';
5
+ import Link from '~hooks/link';
6
+ import { imagePrettyUrl } from '~helpers/getters';
7
+ import { getAltText } from '~helpers/image';
8
+ import MultiStarRating from '~molecules/star-rating/';
9
+ import StarRating from '~molecules/star-rating/one-star';
10
+ import ReviewLink from '~atoms/review-link';
11
+ import Ribbons from '~atoms/ribbons';
11
12
  import useTranslate from '~hooks/useTranslate/useTranslate';
12
13
  import PrettyLink from '~atoms/pretty-link';
13
14
  import VerifiedAuthor from '../../../images/icons/verified-author';
@@ -4,12 +4,13 @@
4
4
  /* eslint-disable import/no-extraneous-dependencies */
5
5
  import React, { useState } from 'react';
6
6
  import PropTypes from 'prop-types';
7
- import OperatorCta from 'gatsby-core-theme/src/components/atoms/button/operator-cta';
8
- import { isMobileDevice } from 'gatsby-core-theme/src/helpers/device-detect';
9
- import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
7
+ import OperatorCta from '~atoms/button/operator-cta';
8
+ import { isMobileDevice } from '~helpers/device-detect';
9
+ import LazyImage from '~hooks/lazy-image';
10
10
  import PrettyLink from '~atoms/pretty-link';
11
11
  import useTranslate from '~hooks/useTranslate/useTranslate';
12
- import { imagePrettyUrl, getAltText } from '~helpers/getters';
12
+ import { imagePrettyUrl } from '~helpers/getters';
13
+ import { getAltText } from '~helpers/image';
13
14
  import { TrackingKeys } from '~constants/tracking-api';
14
15
  import styles from './oeprator-exlusive.module.scss';
15
16
 
@@ -197,6 +197,8 @@ const Modules = ({ module, pageContext, index, exclOperator, serverData, moduleP
197
197
  return lazy(() => import('../../../../components/atoms/teatime-lunchtime-disclaimer'));
198
198
  case 'disquss':
199
199
  return lazy(() => import(`~atoms/disquss`));
200
+ case 'rating_casinos':
201
+ return lazy(() => import('../../../../components/atoms/ratings-with-comments'));
200
202
  default:
201
203
  return null;
202
204
  }
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import useTranslate from '~hooks/useTranslate/useTranslate';
4
+ import { getRating } from '~helpers/rating';
5
+
6
+ import styles from './linear-rating.module.scss';
7
+
8
+ const LinearStarRating = ({
9
+ rating,
10
+ numOfStars = 5,
11
+ active = true,
12
+ showLabel = false,
13
+ icon = null,
14
+ showRatingText = true,
15
+ showDecimal = false,
16
+ showRoundedRating = false,
17
+ }) => {
18
+ // Calculate the percentage for the bar fill based on the rating and numOfStars
19
+ const calculatedRating = getRating(rating, showRoundedRating);
20
+ const percentage = calculatedRating ? ((calculatedRating / numOfStars) * 100) : 0;
21
+
22
+ return (
23
+ <div className={`${styles.starRatingContainer || ''} ${!active && (styles.inactive || '')}`}>
24
+ {showLabel && <span>{useTranslate('rating', 'Rating:')}</span>}
25
+ <div className={styles.bar}>
26
+ <div
27
+ className={styles.fill}
28
+ style={{
29
+ width: `${percentage}%`,
30
+ }}
31
+ />
32
+ </div>
33
+ {showRatingText && (
34
+ <div className={styles.ratingText}>
35
+ {icon && icon}
36
+ {showDecimal ? calculatedRating.toFixed(1) : calculatedRating}
37
+ <span>/</span>
38
+ <span>{numOfStars}</span>
39
+ </div>
40
+ )}
41
+ </div>
42
+ );
43
+ };
44
+
45
+ LinearStarRating.propTypes = {
46
+ numOfStars: PropTypes.oneOf([5, 10]),
47
+ rating: PropTypes.oneOfType([PropTypes.array, PropTypes.number, PropTypes.string]).isRequired,
48
+ active: PropTypes.bool,
49
+ showLabel: PropTypes.bool,
50
+ icon: PropTypes.element,
51
+ showDecimal: PropTypes.bool,
52
+ showRoundedRating: PropTypes.bool,
53
+ showRatingText: PropTypes.bool,
54
+ };
55
+
56
+ export default LinearStarRating;
@@ -0,0 +1,43 @@
1
+ .starRatingContainer {
2
+ display: grid;
3
+ gap: 0.8rem;
4
+ align-items: center;
5
+
6
+ @include min(laptop) {
7
+ grid-template-columns: 3fr 1fr;
8
+ min-width: 21.78rem;
9
+ }
10
+ }
11
+
12
+ .bar {
13
+ position: relative;
14
+ width: 100%;
15
+ height: 0.8rem;
16
+ background-color: #D3E0EC;
17
+ border-radius: 5px;
18
+ overflow: hidden;
19
+ margin: 5px 0;
20
+ min-width: 17.1rem;
21
+ }
22
+
23
+ .fill {
24
+ height: 100%;
25
+ background-color: #FBBF24;
26
+ transition: width 0.3s ease;
27
+ border-radius: 0.8rem;
28
+ }
29
+
30
+ .ratingText {
31
+ color: #0F172A;
32
+ font-size: 1.6rem;
33
+ line-height: 2.6rem;
34
+ font-weight: 600;
35
+ position: absolute;
36
+ right: 0;
37
+ top: 0;
38
+
39
+ @include min(laptop) {
40
+ display: block;
41
+ position: static;
42
+ }
43
+ }