gatsby-core-theme 29.0.7 → 29.0.9
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/.storybook/preview.js +13 -1
- package/CHANGELOG.md +18 -0
- package/package.json +1 -1
- package/src/components/molecules/bonus/template-one/bonus.module.scss +42 -50
- package/src/components/molecules/bonus/template-one/index.js +1 -1
- package/src/components/molecules/bonus/template-two/bonus.module.scss +21 -26
- package/src/components/molecules/bonus/template-two/index.js +1 -1
- package/src/components/molecules/bonus-box/template-four/bonus-box.module.scss +0 -0
- package/src/components/molecules/bonus-box/template-four/bonus-box.test.js +52 -0
- package/src/components/molecules/bonus-box/template-four/bonus.stories.js +49 -0
- package/src/components/molecules/bonus-box/template-four/index.js +25 -0
- package/src/components/molecules/bonus-box/template-one/bonus.stories.js +1 -1
- package/src/components/molecules/bonus-box/template-one/index.js +1 -0
- package/src/components/molecules/bonus-box/template-three/bonus-box.module.scss +6 -5
- package/src/components/molecules/bonus-box/template-three/bonus.stories.js +1 -1
- package/src/components/molecules/bonus-box/template-three/index.js +31 -16
- package/src/components/molecules/bonus-box/template-two/bonus.stories.js +1 -1
- package/src/components/molecules/content/table/table.module.scss +1 -1
package/.storybook/preview.js
CHANGED
|
@@ -19,7 +19,19 @@ export const parameters = {
|
|
|
19
19
|
options: {
|
|
20
20
|
storySort: {
|
|
21
21
|
method: 'alphabetical',
|
|
22
|
-
order: [
|
|
22
|
+
order: [
|
|
23
|
+
'Theme',
|
|
24
|
+
[
|
|
25
|
+
'Layout',
|
|
26
|
+
'Modules',
|
|
27
|
+
'Atoms',
|
|
28
|
+
'Molecules',
|
|
29
|
+
['Bonus box', ['Template One', 'Template Two', 'Template Three', 'Template Four']],
|
|
30
|
+
'Organisms',
|
|
31
|
+
'Pages',
|
|
32
|
+
'Hooks',
|
|
33
|
+
],
|
|
34
|
+
],
|
|
23
35
|
},
|
|
24
36
|
},
|
|
25
37
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## [29.0.9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v29.0.8...v29.0.9) (2023-09-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* bonus box changes ([31580aa](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/31580aa09fa42c273cd062b3383fdaedf2263231))
|
|
7
|
+
|
|
8
|
+
## [29.0.8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v29.0.7...v29.0.8) (2023-09-20)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bonus box changes ([316027c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/316027c3c857094a6b862a280fc2f5c4677d16b2))
|
|
14
|
+
* update styling for mobile table ([bf3a559](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/bf3a559c4199dc23be3b6ded21d8da6e84119102))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
* Merge branch 'mobile-table' into 'master' ([bf7d73a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/bf7d73af08f7f3f642bebf7d80f635e5da4e8c3d))
|
|
18
|
+
|
|
1
19
|
## [29.0.7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v29.0.6...v29.0.7) (2023-09-18)
|
|
2
20
|
|
|
3
21
|
|
package/package.json
CHANGED
|
@@ -7,14 +7,13 @@
|
|
|
7
7
|
padding: 1.6rem;
|
|
8
8
|
gap: 1.6rem;
|
|
9
9
|
|
|
10
|
-
>div {
|
|
10
|
+
> div {
|
|
11
11
|
width: 100%;
|
|
12
12
|
@include flex-direction(column);
|
|
13
13
|
gap: 1.6rem;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
>a {
|
|
16
|
+
> a {
|
|
18
17
|
width: 100%;
|
|
19
18
|
border-radius: 10rem;
|
|
20
19
|
font-size: 1.4rem;
|
|
@@ -22,7 +21,7 @@
|
|
|
22
21
|
font-weight: 700;
|
|
23
22
|
line-height: 2.2rem;
|
|
24
23
|
|
|
25
|
-
>svg {
|
|
24
|
+
> svg {
|
|
26
25
|
width: 1.4rem;
|
|
27
26
|
}
|
|
28
27
|
}
|
|
@@ -34,7 +33,7 @@
|
|
|
34
33
|
@include flex-direction(row);
|
|
35
34
|
gap: 16px;
|
|
36
35
|
|
|
37
|
-
>img {
|
|
36
|
+
> img {
|
|
38
37
|
min-width: 7.2rem;
|
|
39
38
|
width: 7.2rem;
|
|
40
39
|
height: 7.2rem;
|
|
@@ -46,7 +45,7 @@
|
|
|
46
45
|
@include flex-direction(column);
|
|
47
46
|
@include flex-align(flex-start, center);
|
|
48
47
|
|
|
49
|
-
>span:first-of-type {
|
|
48
|
+
> span:first-of-type {
|
|
50
49
|
color: #1b1b1c;
|
|
51
50
|
font-size: 1.6rem;
|
|
52
51
|
font-style: normal;
|
|
@@ -55,7 +54,7 @@
|
|
|
55
54
|
margin-bottom: 0.8rem;
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
>div {
|
|
57
|
+
> div {
|
|
59
58
|
border-radius: 100px;
|
|
60
59
|
background: #fff;
|
|
61
60
|
border: 0px;
|
|
@@ -65,11 +64,11 @@
|
|
|
65
64
|
@include flex-direction(row);
|
|
66
65
|
@include flex-align(center, center);
|
|
67
66
|
|
|
68
|
-
>span:first-of-type {
|
|
67
|
+
> span:first-of-type {
|
|
69
68
|
margin-right: 0.4rem;
|
|
70
69
|
}
|
|
71
70
|
|
|
72
|
-
>span:last-of-type {
|
|
71
|
+
> span:last-of-type {
|
|
73
72
|
font-size: 11px;
|
|
74
73
|
margin-top: 0.2rem;
|
|
75
74
|
}
|
|
@@ -86,7 +85,7 @@
|
|
|
86
85
|
@include flex-align(center, center);
|
|
87
86
|
border: 1px solid #fff;
|
|
88
87
|
|
|
89
|
-
>div {
|
|
88
|
+
> div {
|
|
90
89
|
background-color: #f4f4f4;
|
|
91
90
|
width: 100%;
|
|
92
91
|
box-sizing: border-box;
|
|
@@ -102,33 +101,26 @@
|
|
|
102
101
|
padding: 0.8rem 2rem;
|
|
103
102
|
}
|
|
104
103
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
font-style: normal;
|
|
116
|
-
font-weight: 700;
|
|
117
|
-
line-height: 2.7rem;
|
|
118
|
-
padding-right: 0;
|
|
119
|
-
margin: 0.8rem 0.8rem 0 0.8rem;
|
|
120
|
-
}
|
|
104
|
+
span:first-of-type {
|
|
105
|
+
color: var(--operator-banner-first-bonus, #1b1b1c);
|
|
106
|
+
text-align: center;
|
|
107
|
+
font-size: 1.6rem;
|
|
108
|
+
font-style: normal;
|
|
109
|
+
font-weight: 700;
|
|
110
|
+
line-height: 2.7rem;
|
|
111
|
+
padding-right: 0;
|
|
112
|
+
margin: 0.8rem 0.8rem 0 0.8rem;
|
|
113
|
+
}
|
|
121
114
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
115
|
+
span:last-of-type {
|
|
116
|
+
color: var(--operator-banner-second-bonus, #515156);
|
|
117
|
+
text-align: center;
|
|
118
|
+
font-size: 1.4rem;
|
|
119
|
+
font-style: normal;
|
|
120
|
+
font-weight: 700;
|
|
121
|
+
line-height: 2.2rem;
|
|
122
|
+
padding: 0;
|
|
123
|
+
margin: 0 0.8rem 0.8rem 0.8rem;
|
|
132
124
|
}
|
|
133
125
|
}
|
|
134
126
|
|
|
@@ -138,7 +130,7 @@
|
|
|
138
130
|
@include flex-direction(row);
|
|
139
131
|
@include flex-align(center, center);
|
|
140
132
|
|
|
141
|
-
>a {
|
|
133
|
+
> a {
|
|
142
134
|
min-height: 5.6rem;
|
|
143
135
|
max-width: 19.7rem;
|
|
144
136
|
font-size: 1.8rem;
|
|
@@ -146,17 +138,17 @@
|
|
|
146
138
|
line-height: 2.6rem;
|
|
147
139
|
}
|
|
148
140
|
|
|
149
|
-
>div {
|
|
141
|
+
> div {
|
|
150
142
|
@include flex-direction(row);
|
|
151
143
|
@include flex-align(center, flex-start);
|
|
152
144
|
}
|
|
153
145
|
}
|
|
154
146
|
|
|
155
147
|
.tncEnable {
|
|
156
|
-
>div {
|
|
148
|
+
> div {
|
|
157
149
|
gap: 2.4rem;
|
|
158
150
|
|
|
159
|
-
>div {
|
|
151
|
+
> div {
|
|
160
152
|
gap: 2.4rem;
|
|
161
153
|
}
|
|
162
154
|
}
|
|
@@ -168,7 +160,7 @@
|
|
|
168
160
|
gap: 1.6rem;
|
|
169
161
|
height: auto;
|
|
170
162
|
|
|
171
|
-
>img {
|
|
163
|
+
> img {
|
|
172
164
|
min-width: 6.4rem;
|
|
173
165
|
width: 6.4rem;
|
|
174
166
|
height: 6.4rem;
|
|
@@ -176,7 +168,7 @@
|
|
|
176
168
|
}
|
|
177
169
|
|
|
178
170
|
.tncEnable .logo {
|
|
179
|
-
>img {
|
|
171
|
+
> img {
|
|
180
172
|
min-width: 9.6rem;
|
|
181
173
|
width: 9.6rem;
|
|
182
174
|
height: 9.6rem;
|
|
@@ -187,7 +179,7 @@
|
|
|
187
179
|
display: flex;
|
|
188
180
|
flex-direction: column;
|
|
189
181
|
|
|
190
|
-
>span:first-of-type {
|
|
182
|
+
> span:first-of-type {
|
|
191
183
|
color: var(--operator-banner-name-color, #1b1b1c);
|
|
192
184
|
font-size: 1.4rem;
|
|
193
185
|
font-style: normal;
|
|
@@ -200,8 +192,8 @@
|
|
|
200
192
|
}
|
|
201
193
|
|
|
202
194
|
.showTncFixed {
|
|
203
|
-
>div {
|
|
204
|
-
>div:last-child {
|
|
195
|
+
> div {
|
|
196
|
+
> div:last-child {
|
|
205
197
|
height: 42px;
|
|
206
198
|
overflow-y: scroll;
|
|
207
199
|
color: #515156;
|
|
@@ -229,26 +221,26 @@
|
|
|
229
221
|
}
|
|
230
222
|
|
|
231
223
|
@include min(tablet) {
|
|
232
|
-
>div {
|
|
224
|
+
> div {
|
|
233
225
|
display: grid;
|
|
234
226
|
grid-template-columns: 1fr 20rem;
|
|
235
227
|
grid-template-rows: auto auto;
|
|
236
228
|
|
|
237
|
-
>div:last-of-type {
|
|
229
|
+
> div:last-of-type {
|
|
238
230
|
grid-column: 1/3;
|
|
239
231
|
grid-row: 2/3;
|
|
240
232
|
display: block;
|
|
241
233
|
}
|
|
242
234
|
|
|
243
|
-
>a {
|
|
235
|
+
> a {
|
|
244
236
|
grid-row: 1/2;
|
|
245
237
|
grid-column: 2/3;
|
|
246
238
|
}
|
|
247
239
|
|
|
248
|
-
>div:first-of-type {
|
|
240
|
+
> div:first-of-type {
|
|
249
241
|
grid-row: 1/2;
|
|
250
242
|
grid-column: 1/2;
|
|
251
243
|
}
|
|
252
244
|
}
|
|
253
245
|
}
|
|
254
|
-
}
|
|
246
|
+
}
|
|
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
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
|
-
import BonusBox from '~molecules/bonus-box/template-
|
|
7
|
+
import BonusBox from '~molecules/bonus-box/template-four';
|
|
8
8
|
import OperatorCta from '~atoms/operator-cta-button';
|
|
9
9
|
import Rating from '~molecules/star-rating/one-star';
|
|
10
10
|
import Tnc from '~molecules/tnc';
|
|
@@ -57,26 +57,22 @@
|
|
|
57
57
|
}
|
|
58
58
|
.bonus {
|
|
59
59
|
line-height: 2px;
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
|
|
61
|
+
p {
|
|
62
|
+
color: #3c3c40;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
span {
|
|
66
|
+
color: #1b1b1c;
|
|
67
|
+
font-size: 2rem;
|
|
68
|
+
font-style: normal;
|
|
69
|
+
font-weight: 700;
|
|
70
|
+
line-height: 2.8rem;
|
|
71
|
+
text-transform: capitalize;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
> span:last-child {
|
|
62
75
|
padding: 0;
|
|
63
|
-
width: auto;
|
|
64
|
-
background: none;
|
|
65
|
-
border: none;
|
|
66
|
-
text-align: right;
|
|
67
|
-
width: auto;
|
|
68
|
-
display: contents;
|
|
69
|
-
span {
|
|
70
|
-
font-size: 1.2rem;
|
|
71
|
-
font-style: normal;
|
|
72
|
-
font-weight: 700;
|
|
73
|
-
line-height: 1.8rem;
|
|
74
|
-
color: #fff;
|
|
75
|
-
text-align: left;
|
|
76
|
-
}
|
|
77
|
-
> span:last-child {
|
|
78
|
-
padding: 0;
|
|
79
|
-
}
|
|
80
76
|
}
|
|
81
77
|
}
|
|
82
78
|
|
|
@@ -112,7 +108,7 @@
|
|
|
112
108
|
padding-right: 1rem;
|
|
113
109
|
}
|
|
114
110
|
.tncEnable .bonus {
|
|
115
|
-
>a{
|
|
111
|
+
> a {
|
|
116
112
|
> span {
|
|
117
113
|
color: #1b1b1c;
|
|
118
114
|
}
|
|
@@ -130,7 +126,7 @@
|
|
|
130
126
|
color: rgb(100, 100, 109) !important;
|
|
131
127
|
}
|
|
132
128
|
.showTncFixed {
|
|
133
|
-
border-top: 1.5px solid var(--ui-kit-colours-white-900, #
|
|
129
|
+
border-top: 1.5px solid var(--ui-kit-colours-white-900, #dedede);
|
|
134
130
|
> div {
|
|
135
131
|
display: grid;
|
|
136
132
|
grid-template-columns: 1fr 8rem;
|
|
@@ -165,7 +161,6 @@
|
|
|
165
161
|
grid-row: 1/2;
|
|
166
162
|
}
|
|
167
163
|
}
|
|
168
|
-
|
|
169
164
|
}
|
|
170
165
|
@include min(tablet) {
|
|
171
166
|
.operatorBanner {
|
|
@@ -182,7 +177,7 @@
|
|
|
182
177
|
font-weight: 700;
|
|
183
178
|
line-height: 2.6rem;
|
|
184
179
|
text-transform: capitalize;
|
|
185
|
-
@include min(laptop){
|
|
180
|
+
@include min(laptop) {
|
|
186
181
|
min-width: 19.7rem;
|
|
187
182
|
}
|
|
188
183
|
> svg {
|
|
@@ -242,7 +237,7 @@
|
|
|
242
237
|
.bonus {
|
|
243
238
|
text-align: center;
|
|
244
239
|
width: 100%;
|
|
245
|
-
>a{
|
|
240
|
+
> a {
|
|
246
241
|
> span {
|
|
247
242
|
font-size: 2rem;
|
|
248
243
|
font-style: normal;
|
|
@@ -261,9 +256,9 @@
|
|
|
261
256
|
> span:first-child {
|
|
262
257
|
color: #1b1b1c;
|
|
263
258
|
}
|
|
264
|
-
>div{
|
|
259
|
+
> div {
|
|
265
260
|
background-color: white;
|
|
266
|
-
color: #
|
|
261
|
+
color: #1b1b1c;
|
|
267
262
|
}
|
|
268
263
|
}
|
|
269
264
|
.tncEnable .welcomeBonus {
|
|
@@ -6,7 +6,7 @@ import { IoMdClose } from '@react-icons/all-files/io/IoMdClose';
|
|
|
6
6
|
import { prettyTracker, imagePrettyUrl, translate } from '~helpers/getters';
|
|
7
7
|
import LazyImage from '~hooks/lazy-image';
|
|
8
8
|
import isSticky from '~hooks/stickyOnScroll';
|
|
9
|
-
import BonusBox from '~molecules/bonus-box/template-
|
|
9
|
+
import BonusBox from '~molecules/bonus-box/template-four';
|
|
10
10
|
import OperatorCta from '~atoms/operator-cta-button';
|
|
11
11
|
import Rating from '~molecules/star-rating/one-star';
|
|
12
12
|
import Tnc from '~molecules/tnc';
|
|
File without changes
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, cleanup } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
4
|
+
|
|
5
|
+
import { getToplistItem } from '~tests/factories/modules/toplist.factory';
|
|
6
|
+
import Bonus from '.';
|
|
7
|
+
|
|
8
|
+
describe('Bonus Component', () => {
|
|
9
|
+
test('render with props', () => {
|
|
10
|
+
const item = getToplistItem();
|
|
11
|
+
const { getByText } = render(<Bonus item={item} tracker="main" />);
|
|
12
|
+
expect(getByText('€100 welcome bonus')).toBeTruthy();
|
|
13
|
+
});
|
|
14
|
+
test('render with main onliner', () => {
|
|
15
|
+
const { getByText } = render(
|
|
16
|
+
<Bonus
|
|
17
|
+
item={{
|
|
18
|
+
one_liners: {
|
|
19
|
+
one_liner: 'welcome bonus',
|
|
20
|
+
},
|
|
21
|
+
bonus: {
|
|
22
|
+
one_liners: {
|
|
23
|
+
main: {
|
|
24
|
+
one_liner: 'welcome bonus',
|
|
25
|
+
},
|
|
26
|
+
secondary: {
|
|
27
|
+
one_liner: 'Welcome Bonus up to £1000',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
}}
|
|
32
|
+
tracker="main"
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
expect(getByText('welcome bonus')).toBeTruthy();
|
|
36
|
+
});
|
|
37
|
+
test('without oneLiner', () => {
|
|
38
|
+
const { queryByText } = render(
|
|
39
|
+
<Bonus
|
|
40
|
+
item={{
|
|
41
|
+
one_liners: {},
|
|
42
|
+
bonus: {},
|
|
43
|
+
}}
|
|
44
|
+
tracker="main"
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
expect(queryByText('welcome bonus')).toBeNull();
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
afterEach(() => {
|
|
51
|
+
cleanup();
|
|
52
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Title,
|
|
4
|
+
Description,
|
|
5
|
+
Primary,
|
|
6
|
+
PRIMARY_STORY,
|
|
7
|
+
ArgsTable,
|
|
8
|
+
} from '@storybook/addon-docs/blocks';
|
|
9
|
+
|
|
10
|
+
import BonusBox from '.';
|
|
11
|
+
import getPageData from '~tests/factories/pages/default.factory';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
title: 'Theme/Molecules/Bonus box/Template Four',
|
|
15
|
+
component: BonusBox,
|
|
16
|
+
args: {
|
|
17
|
+
item: {
|
|
18
|
+
name: 'operator',
|
|
19
|
+
type: { name: 'object', required: false },
|
|
20
|
+
description: 'The Operator data object.',
|
|
21
|
+
table: {
|
|
22
|
+
type: { summary: 'object' },
|
|
23
|
+
defaultValue: { summary: '' },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
parameters: {
|
|
28
|
+
docs: {
|
|
29
|
+
description: {
|
|
30
|
+
component: 'Generates a banner including the operator data.',
|
|
31
|
+
},
|
|
32
|
+
page: () => (
|
|
33
|
+
<>
|
|
34
|
+
<Title />
|
|
35
|
+
<Description />
|
|
36
|
+
<Primary />
|
|
37
|
+
<ArgsTable story={PRIMARY_STORY} />
|
|
38
|
+
</>
|
|
39
|
+
),
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const Template = (args) => <BonusBox {...args} />;
|
|
45
|
+
|
|
46
|
+
export const Default = Template.bind({});
|
|
47
|
+
Default.args = {
|
|
48
|
+
item: getPageData().relation,
|
|
49
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { getBonusData } from '~helpers/getters.mjs';
|
|
4
|
+
import styles from './bonus-box.module.scss';
|
|
5
|
+
|
|
6
|
+
export default function BonusBox({ item, tracker, splitBy = '+', feSeparator = '+' }) {
|
|
7
|
+
const data = getBonusData(item, tracker, splitBy);
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
{data?.mainLine && <span className={styles.firstPart}>{data.mainLine}</span>}
|
|
12
|
+
{data?.secondLine && (
|
|
13
|
+
<span className={styles.secondPart}>{`${feSeparator}${data.secondLine}`}</span>
|
|
14
|
+
)}
|
|
15
|
+
</>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
BonusBox.propTypes = {
|
|
20
|
+
item: PropTypes.shape({}),
|
|
21
|
+
tracker: PropTypes.string,
|
|
22
|
+
pageTemplate: PropTypes.string,
|
|
23
|
+
splitBy: PropTypes.string,
|
|
24
|
+
feSeparator: PropTypes.string,
|
|
25
|
+
};
|
|
@@ -12,7 +12,7 @@ import BonusBox from '.';
|
|
|
12
12
|
import getPageData from '~tests/factories/pages/default.factory';
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
|
-
title: 'Theme/Molecules/Bonus
|
|
15
|
+
title: 'Theme/Molecules/Bonus box/Template One',
|
|
16
16
|
component: BonusBox,
|
|
17
17
|
args: {
|
|
18
18
|
item: {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
.bonusBox {
|
|
2
|
-
@include flex-direction(column);
|
|
3
2
|
@include flex-align(center, center);
|
|
4
3
|
border-radius: 16px;
|
|
5
4
|
background: var(--bonus-box-backgorund, #e9faf1);
|
|
@@ -8,8 +7,11 @@
|
|
|
8
7
|
padding: 16px;
|
|
9
8
|
width: 100%;
|
|
10
9
|
max-width: 50.5rem;
|
|
10
|
+
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
.includeVariableComponent {
|
|
13
|
+
@include flex-direction(column);
|
|
14
|
+
> div {
|
|
13
15
|
@include flex-direction(column);
|
|
14
16
|
@include flex-align(center, center);
|
|
15
17
|
|
|
@@ -25,7 +27,7 @@
|
|
|
25
27
|
@include flex-direction(column);
|
|
26
28
|
@include flex-align(center, center);
|
|
27
29
|
width: 100%;
|
|
28
|
-
>p {
|
|
30
|
+
> p {
|
|
29
31
|
color: var(--bonus-box-welcome-bonus-color, #1b1b1c);
|
|
30
32
|
text-align: center;
|
|
31
33
|
font-size: 1.4rem;
|
|
@@ -34,7 +36,7 @@
|
|
|
34
36
|
line-height: 2.2rem;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
>span {
|
|
39
|
+
> span {
|
|
38
40
|
color: var(--bonus-box-main-text-color, #1b1b1c);
|
|
39
41
|
text-align: center;
|
|
40
42
|
font-size: 1.7rem;
|
|
@@ -45,4 +47,3 @@
|
|
|
45
47
|
width: 24rem;
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
|
-
|
|
@@ -12,7 +12,7 @@ import BonusBox from '.';
|
|
|
12
12
|
import getPageData from '~tests/factories/pages/default.factory';
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
|
-
title: 'Theme/Molecules/Bonus
|
|
15
|
+
title: 'Theme/Molecules/Bonus box/Template Three',
|
|
16
16
|
component: BonusBox,
|
|
17
17
|
args: {
|
|
18
18
|
translations: {
|
|
@@ -22,24 +22,39 @@ export default function BonusBox({
|
|
|
22
22
|
const prettyLink = prettyTracker(item, tracker, false, pageTemplate);
|
|
23
23
|
const data = getBonusData(item, tracker, splitBy);
|
|
24
24
|
|
|
25
|
+
const content = () => (
|
|
26
|
+
<a
|
|
27
|
+
href={prettyLink || '#'}
|
|
28
|
+
target="_blank"
|
|
29
|
+
rel="nofollow noreferrer"
|
|
30
|
+
className={`${styles.detailsBox} ${'bonus-box-gtm'}`}
|
|
31
|
+
>
|
|
32
|
+
{welcomeBonus && <p>{welcomeBonusTranslation}</p>}
|
|
33
|
+
{data?.mainLine && <span className={styles.firstPart}>{data.mainLine}</span>}
|
|
34
|
+
{data?.secondLine && (
|
|
35
|
+
<span className={styles.secondPart}>{`${feSeparator}${data.secondLine}`}</span>
|
|
36
|
+
)}
|
|
37
|
+
</a>
|
|
38
|
+
);
|
|
39
|
+
|
|
25
40
|
return (
|
|
26
|
-
<div
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
)}
|
|
39
|
-
|
|
41
|
+
<div
|
|
42
|
+
className={`${styles.bonusBox} ${
|
|
43
|
+
showVariablesComponent ? styles.includeVariableComponent : ''
|
|
44
|
+
}`}
|
|
45
|
+
>
|
|
46
|
+
{!showVariablesComponent ? (
|
|
47
|
+
<>
|
|
48
|
+
{content()}
|
|
49
|
+
{ctaBtn && <CtaButton operator={item} icon={<FaArrowRight />} />}
|
|
50
|
+
</>
|
|
51
|
+
) : (
|
|
52
|
+
<div>
|
|
53
|
+
{content()}
|
|
54
|
+
{ctaBtn && <CtaButton operator={item} icon={<FaArrowRight />} />}
|
|
55
|
+
</div>
|
|
56
|
+
)}
|
|
40
57
|
|
|
41
|
-
{ctaBtn && <CtaButton operator={item} icon={<FaArrowRight />} />}
|
|
42
|
-
</div>
|
|
43
58
|
{showVariablesComponent && <VariableComponent item={item} />}
|
|
44
59
|
</div>
|
|
45
60
|
);
|
|
@@ -11,7 +11,7 @@ import BonusBox from '.';
|
|
|
11
11
|
import getPageData from '~tests/factories/pages/default.factory';
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
|
-
title: 'Theme/Molecules/Bonus
|
|
14
|
+
title: 'Theme/Molecules/Bonus box/Template Two',
|
|
15
15
|
component: BonusBox,
|
|
16
16
|
args: {
|
|
17
17
|
translations: {
|