gatsby-core-theme 30.0.84 → 30.0.86
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 +24 -0
- package/package.json +1 -1
- package/src/components/molecules/footer/footer.test.js +54 -220
- package/src/components/molecules/footer/index.js +23 -125
- package/src/components/molecules/footer/variants/template-one/index.js +126 -0
- package/src/components/molecules/footer/{footer.stories.js → variants/template-one/template-one.stories.js} +1 -1
- package/src/components/molecules/footer/variants/template-one/template-one.test.js +252 -0
- package/src/components/molecules/footer/variants/template-three/index.js +134 -0
- package/src/components/molecules/footer/variants/template-three/template-three.module.scss +146 -0
- package/src/components/molecules/footer/variants/template-three/template-three.stories.js +175 -0
- package/src/components/molecules/footer/variants/template-three/template-three.test.js +252 -0
- package/src/components/molecules/footer/variants/template-two/index.js +131 -0
- package/src/components/molecules/footer/variants/template-two/template-two.module.scss +146 -0
- package/src/components/molecules/footer/variants/template-two/template-two.stories.js +175 -0
- package/src/components/molecules/footer/variants/template-two/template-two.test.js +251 -0
- /package/src/components/molecules/footer/{footer.module.scss → variants/template-one/template-one.module.scss} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## [30.0.86](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.85...v30.0.86) (2024-02-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* used phonenum for helpline ([00ac2d5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/00ac2d5dc62314c76aadf2b09cbe7d92b2ceb5ef))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
* Merge branch 'tm-4047-market-helpline' into 'master' ([d2ae2b3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d2ae2b3a4399146c9e4f501d18a99e63007edcbf))
|
|
10
|
+
* Merge remote-tracking branch 'origin' into tm-4047-market-helpline ([713c588](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/713c588b487c531740c9519fdd703b01d464ef69))
|
|
11
|
+
|
|
12
|
+
## [30.0.85](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.84...v30.0.85) (2024-02-21)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* added all templates to core ([61b2c5b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/61b2c5b58b4746fca369d5454bd71c635672d029))
|
|
18
|
+
* added storybook resources ([7df8998](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7df89986e139f54d5c6fdf0af68edf3f747b6f5a))
|
|
19
|
+
* fixed failing tests ([bcae945](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/bcae9458d86a5ab8a5d4c4895ac2cede6a886ea4))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* Merge branch 'tm-4047-market-helpline' into 'master' ([04f08df](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/04f08df3f7c8d19b38288889a6c0bf8ea18b6e62))
|
|
23
|
+
* Merge remote-tracking branch 'origin' into tm-4047-market-helpline ([23b40d0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/23b40d03155497cf2de1bc7e90b5ee188cf58e6f))
|
|
24
|
+
|
|
1
25
|
## [30.0.84](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.83...v30.0.84) (2024-02-21)
|
|
2
26
|
|
|
3
27
|
|
package/package.json
CHANGED
|
@@ -1,249 +1,83 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, cleanup, waitFor } from '@testing-library/react';
|
|
3
3
|
import '@testing-library/jest-dom/extend-expect';
|
|
4
|
+
import '~tests/helpers/match-media.mock';
|
|
4
5
|
import Footer from '.';
|
|
5
|
-
import { getExtraField, translate, copyrightText } from '../../../helpers/getters';
|
|
6
|
-
import MainProvider from '~context/MainProvider';
|
|
7
6
|
import getFooterData from '../../../../tests/factories/modules/footer.factory';
|
|
7
|
+
import getPageData from '../../../../tests/factories/pages/default.factory';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
website
|
|
20
|
-
</a>
|
|
21
|
-
in order to get help.
|
|
22
|
-
</p>`;
|
|
23
|
-
const phoneNum = '- 89 241 5401';
|
|
24
|
-
|
|
25
|
-
const dmcaImg = (
|
|
26
|
-
<img
|
|
27
|
-
src="https://cdn.irishluck.ie/5d29ae7f19cc9366a119f3ca168395d7.png"
|
|
28
|
-
width="100"
|
|
29
|
-
height="33"
|
|
30
|
-
alt="DMCA.com Protection Status"
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
function renderComponent(footerData) {
|
|
35
|
-
return render(
|
|
36
|
-
<MainProvider
|
|
37
|
-
value={{
|
|
38
|
-
translations,
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
<Footer {...footerData} />
|
|
42
|
-
</MainProvider>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
let data;
|
|
47
|
-
let props;
|
|
48
|
-
let footerMenu;
|
|
49
|
-
let asSeenOn;
|
|
50
|
-
let gamblingText;
|
|
51
|
-
let socialIcons;
|
|
52
|
-
let copyrightDisclaimer;
|
|
53
|
-
let footerLogos;
|
|
54
|
-
|
|
55
|
-
beforeEach(() => {
|
|
56
|
-
data = getFooterData();
|
|
57
|
-
footerMenu = getExtraField(data?.extra_fields, 'links');
|
|
58
|
-
asSeenOn = getExtraField(data?.extra_fields, 'as_seen_on');
|
|
59
|
-
gamblingText = getExtraField(data?.extra_fields, 'gambling_text');
|
|
60
|
-
socialIcons = getExtraField(data?.extra_fields, 'social_icons');
|
|
61
|
-
copyrightDisclaimer = getExtraField(data.extra_fields, 'copyright_disclaimer');
|
|
62
|
-
footerLogos = getExtraField(data?.extra_fields, 'logos');
|
|
9
|
+
describe('header component', () => {
|
|
10
|
+
test('render', async () => {
|
|
11
|
+
const { container } = render(
|
|
12
|
+
<Footer
|
|
13
|
+
section={getFooterData()}
|
|
14
|
+
template="homepage"
|
|
15
|
+
hasFooterLinks={false}
|
|
16
|
+
footerTemplate="template_one"
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
63
19
|
|
|
64
|
-
props = {
|
|
65
|
-
section: data,
|
|
66
|
-
template: 'default',
|
|
67
|
-
hasFooterLinks: false,
|
|
68
|
-
footerTemplate: 'template_one',
|
|
69
|
-
showLinks: true,
|
|
70
|
-
copyrightDisclaimer,
|
|
71
|
-
footerLogos,
|
|
72
|
-
footerMenu,
|
|
73
|
-
asSeenOn,
|
|
74
|
-
gamblingText,
|
|
75
|
-
socialIcons,
|
|
76
|
-
hasDisclaimer: true,
|
|
77
|
-
showCopyright: true,
|
|
78
|
-
logo: '../../../images/logo.svg',
|
|
79
|
-
securityIcon: '../../../images/security.svg',
|
|
80
|
-
helpText,
|
|
81
|
-
phoneNum,
|
|
82
|
-
dmcaImg,
|
|
83
|
-
};
|
|
84
|
-
});
|
|
85
|
-
describe('Show Footer', () => {
|
|
86
|
-
test('render with props', () => {
|
|
87
|
-
const { container } = renderComponent(props);
|
|
88
|
-
expect(container).toBeTruthy();
|
|
89
|
-
});
|
|
90
|
-
test('show correct template ', async () => {
|
|
91
|
-
const { container } = renderComponent(props);
|
|
92
20
|
await waitFor(() => {
|
|
93
|
-
expect(container.querySelectorAll('
|
|
21
|
+
expect(container.querySelectorAll('footer')).toHaveLength(1);
|
|
94
22
|
});
|
|
95
23
|
});
|
|
96
|
-
test('
|
|
97
|
-
const { container
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
24
|
+
test('Template Two', async () => {
|
|
25
|
+
const { container } = render(
|
|
26
|
+
<Footer
|
|
27
|
+
section={getFooterData()}
|
|
28
|
+
template="homepage"
|
|
29
|
+
hasFooterLinks={false}
|
|
30
|
+
footerTemplate="template_two"
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
104
33
|
|
|
105
|
-
// show correct number of logos
|
|
106
|
-
expect(container.querySelectorAll('.asSeenOn li')).toHaveLength(3);
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
test('hide as seen on', async () => {
|
|
110
|
-
props = {
|
|
111
|
-
...props,
|
|
112
|
-
asSeenOn: null,
|
|
113
|
-
};
|
|
114
|
-
const { container } = renderComponent(props);
|
|
115
34
|
await waitFor(() => {
|
|
116
|
-
expect(container.querySelectorAll('footer
|
|
117
|
-
expect(container.querySelectorAll('.
|
|
35
|
+
expect(container.querySelectorAll('.footer.templateOne')).toHaveLength(0);
|
|
36
|
+
expect(container.querySelectorAll('.footer.templateTwo')).toHaveLength(1);
|
|
37
|
+
expect(container.querySelectorAll('.footer.templateThree')).toHaveLength(0);
|
|
118
38
|
});
|
|
119
39
|
});
|
|
120
|
-
test('
|
|
121
|
-
const { container
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
expect(getByText(footerMenu.children[0].title)).toBeTruthy();
|
|
130
|
-
expect(getByText(footerMenu.children[2].title)).toBeTruthy();
|
|
131
|
-
|
|
132
|
-
// show correct number of child lists
|
|
133
|
-
expect(getByText(footerMenu.children[1].title).closest('ul').children).toHaveLength(7);
|
|
134
|
-
expect(getByText(footerMenu.children[3].title).closest('ul').children).toHaveLength(5);
|
|
40
|
+
test('Template Three', async () => {
|
|
41
|
+
const { container } = render(
|
|
42
|
+
<Footer
|
|
43
|
+
section={getFooterData()}
|
|
44
|
+
template="homepage"
|
|
45
|
+
hasFooterLinks={false}
|
|
46
|
+
footerTemplate="template_three"
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
135
49
|
|
|
136
|
-
// show correct url
|
|
137
|
-
expect(
|
|
138
|
-
getByText(footerMenu.children[1].children[0].title).closest('a').getAttribute('href')
|
|
139
|
-
).toEqual(`/${footerMenu.children[1].children[0].value}`);
|
|
140
|
-
expect(
|
|
141
|
-
getByText(footerMenu.children[2].children[2].title).closest('a').getAttribute('href')
|
|
142
|
-
).toEqual(`/${footerMenu.children[2].children[2].value}`);
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
test('hide menu list', async () => {
|
|
146
|
-
props = {
|
|
147
|
-
...props,
|
|
148
|
-
showLinks: false,
|
|
149
|
-
};
|
|
150
|
-
const { container } = renderComponent(props);
|
|
151
|
-
await waitFor(() => {
|
|
152
|
-
expect(container.querySelectorAll('.links')).toHaveLength(0);
|
|
153
|
-
expect(container.querySelectorAll('.links ul')).toHaveLength(0);
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
test('hide gambling text', async () => {
|
|
157
|
-
const { container } = renderComponent(props);
|
|
158
50
|
await waitFor(() => {
|
|
159
|
-
expect(container.querySelectorAll('.
|
|
160
|
-
expect(container.querySelectorAll('.
|
|
51
|
+
expect(container.querySelectorAll('.footer.templateOne')).toHaveLength(0);
|
|
52
|
+
expect(container.querySelectorAll('.footer.templateTwo')).toHaveLength(0);
|
|
53
|
+
expect(container.querySelectorAll('.footer.templateThree')).toHaveLength(1);
|
|
161
54
|
});
|
|
162
55
|
});
|
|
163
|
-
test('
|
|
164
|
-
const {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
getByText(translate(translations, 'licensed_casinos', 'We only list licensed casinos'))
|
|
168
|
-
.closest('span')
|
|
169
|
-
.getAttribute('class')
|
|
170
|
-
).toContain('securityText');
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
test('footer middle part does not show another as seen on', async () => {
|
|
174
|
-
const { container } = renderComponent(props);
|
|
175
|
-
await waitFor(() => {
|
|
176
|
-
expect(container.querySelectorAll('.footerHotline > div')).toHaveLength(1);
|
|
177
|
-
expect(container.querySelectorAll('.footerHotline .asSeenOn')).toHaveLength(0);
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
test('correct help text', async () => {
|
|
181
|
-
const { container } = renderComponent(props);
|
|
182
|
-
await waitFor(() => {
|
|
183
|
-
expect(container.querySelector('.helpText')).toBeTruthy();
|
|
184
|
-
expect(container.querySelector('.helpText').innerHTML).toBe(helpText);
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
test('correct phone number', async () => {
|
|
188
|
-
const { getByText, container } = renderComponent(props);
|
|
189
|
-
await waitFor(() => {
|
|
190
|
-
expect(getByText(phoneNum)).toBeTruthy();
|
|
191
|
-
expect(container.querySelector('.phoneNum').innerHTML.split('</svg>')[1]).toBe(phoneNum);
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
test('show copyright disclaimer', async () => {
|
|
195
|
-
const { container } = renderComponent(props);
|
|
196
|
-
await waitFor(() => {
|
|
197
|
-
expect(container.querySelectorAll('.copyrightDisclaimer')).toBeTruthy();
|
|
56
|
+
test('Default Template', async () => {
|
|
57
|
+
const { container } = render(
|
|
58
|
+
<Footer section={getFooterData()} template="homepage" hasFooterLinks={false} />
|
|
59
|
+
);
|
|
198
60
|
|
|
199
|
-
expect(container.querySelector('.copyrightDisclaimer').innerHTML).toBe(copyrightDisclaimer);
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
test('show copyright', async () => {
|
|
203
|
-
const { container } = renderComponent(props);
|
|
204
61
|
await waitFor(() => {
|
|
205
|
-
expect(container.
|
|
62
|
+
expect(container.querySelectorAll('.footer.templateOne')).toHaveLength(1);
|
|
63
|
+
expect(container.querySelectorAll('.footer.templateTwo')).toHaveLength(0);
|
|
64
|
+
expect(container.querySelectorAll('.footer.templateThree')).toHaveLength(0);
|
|
206
65
|
});
|
|
207
66
|
});
|
|
208
|
-
test('
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
const { container } = renderComponent(props);
|
|
67
|
+
test('Test new responsible gaming logos', async () => {
|
|
68
|
+
const { container } = render(
|
|
69
|
+
<Footer section={getFooterData()} template="homepage" page={getPageData()} />
|
|
70
|
+
);
|
|
71
|
+
|
|
214
72
|
await waitFor(() => {
|
|
215
|
-
expect(container.
|
|
73
|
+
expect(container.querySelectorAll('.footer .logos li')).toHaveLength(3);
|
|
216
74
|
});
|
|
217
75
|
});
|
|
218
|
-
test('
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
func.isNativeImageLazyLoadingSupported = jest.fn(() => true);
|
|
222
|
-
props = {
|
|
223
|
-
...props,
|
|
224
|
-
showCopyright: false,
|
|
225
|
-
dmcaImage: '../../../images/dmca.png',
|
|
226
|
-
};
|
|
227
|
-
const { container } = renderComponent(props);
|
|
228
|
-
expect(container.querySelector('.logos > a').querySelector('img')).toBeTruthy();
|
|
229
|
-
expect(container.querySelector('.logos > a').querySelector('img')).toHaveAttribute(
|
|
230
|
-
'src',
|
|
231
|
-
'../../../images/dmca.png'
|
|
232
|
-
);
|
|
233
|
-
expect(container.querySelector('.logos > a').querySelector('img')).toHaveAttribute(
|
|
234
|
-
'loading',
|
|
235
|
-
'lazy'
|
|
236
|
-
);
|
|
237
|
-
});
|
|
238
|
-
test('hide dmca image', async () => {
|
|
239
|
-
props = {
|
|
240
|
-
...props,
|
|
241
|
-
hasDisclaimer: false,
|
|
242
|
-
footerLogos: false,
|
|
243
|
-
};
|
|
244
|
-
const { container } = renderComponent(props);
|
|
76
|
+
test('Test when new responsible gaming logos are not available', async () => {
|
|
77
|
+
const { container } = render(<Footer section={getFooterData()} template="homepage" />);
|
|
78
|
+
|
|
245
79
|
await waitFor(() => {
|
|
246
|
-
expect(container.
|
|
80
|
+
expect(container.querySelectorAll('.footer .logos li')).toHaveLength(3);
|
|
247
81
|
});
|
|
248
82
|
});
|
|
249
83
|
});
|
|
@@ -1,108 +1,28 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import loadable from '@loadable/component';
|
|
5
|
-
import {
|
|
6
|
-
import LinkList from '../link-list';
|
|
7
|
-
import Disclaimer from '../../atoms/disclaimer';
|
|
8
|
-
import FooterHotline from '../../atoms/footer/hotline';
|
|
9
|
-
import FooterLicense from '../../atoms/footer/license';
|
|
10
|
-
import styles from './footer.module.scss';
|
|
4
|
+
import { getExtraField } from 'gatsby-core-theme/src/helpers/getters';
|
|
11
5
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
footerMenu,
|
|
15
|
-
copyrightDisclaimer,
|
|
16
|
-
showLinks,
|
|
17
|
-
asSeenOn,
|
|
18
|
-
gamblingText,
|
|
19
|
-
socialIcons,
|
|
20
|
-
hasFooterLinks,
|
|
21
|
-
hasDisclaimer,
|
|
22
|
-
showCopyright,
|
|
23
|
-
helpText,
|
|
24
|
-
phoneNum,
|
|
25
|
-
logo,
|
|
26
|
-
dmcaImage,
|
|
27
|
-
dmcaWidth,
|
|
28
|
-
dmcaHeight,
|
|
29
|
-
securityIcon,
|
|
30
|
-
}) => {
|
|
31
|
-
const AsSeenOn = asSeenOn ? loadable(() => import('../../atoms/footer/as-seen-on')) : null;
|
|
6
|
+
export const footerContent = (props) => {
|
|
7
|
+
let ModuleComponent = null;
|
|
32
8
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<FooterLicense
|
|
48
|
-
gamblingText={gamblingText}
|
|
49
|
-
socialIcons={socialIcons}
|
|
50
|
-
template="templateOne"
|
|
51
|
-
logo={logo}
|
|
52
|
-
securityIcon={securityIcon}
|
|
53
|
-
/>
|
|
54
|
-
</div>
|
|
55
|
-
)}
|
|
56
|
-
|
|
57
|
-
{(helpText || phoneNum) && (
|
|
58
|
-
<FooterHotline
|
|
59
|
-
showAsSeen={false}
|
|
60
|
-
helpText={helpText}
|
|
61
|
-
phoneNum={phoneNum}
|
|
62
|
-
template="templateOne"
|
|
63
|
-
/>
|
|
64
|
-
)}
|
|
65
|
-
|
|
66
|
-
<div className={styles?.bottomPart || ''}>
|
|
67
|
-
{copyrightDisclaimer && (
|
|
68
|
-
<div
|
|
69
|
-
className={styles?.copyrightDisclaimer || ''}
|
|
70
|
-
// eslint-disable-next-line react/no-danger
|
|
71
|
-
dangerouslySetInnerHTML={{ __html: copyrightDisclaimer }}
|
|
72
|
-
/>
|
|
73
|
-
)}
|
|
74
|
-
{showCopyright && <p className={styles?.copyrightText || ''}>{copyrightText()}</p>}
|
|
75
|
-
|
|
76
|
-
{(footerLogos || hasDisclaimer) && (
|
|
77
|
-
<div className={styles?.logos || ''}>
|
|
78
|
-
{footerLogos && (
|
|
79
|
-
<LinkList
|
|
80
|
-
showListTitle={false}
|
|
81
|
-
imageOnly
|
|
82
|
-
singleList
|
|
83
|
-
lists={footerLogos}
|
|
84
|
-
gtmClass="mobile-menu-gtm logo-cta"
|
|
85
|
-
width={130}
|
|
86
|
-
height={140}
|
|
87
|
-
/>
|
|
88
|
-
)}
|
|
89
|
-
{hasDisclaimer && (
|
|
90
|
-
<Disclaimer
|
|
91
|
-
loading="lazy"
|
|
92
|
-
dmcaImage={dmcaImage}
|
|
93
|
-
imgWidth={dmcaWidth}
|
|
94
|
-
imgHeight={dmcaHeight}
|
|
95
|
-
/>
|
|
96
|
-
)}
|
|
97
|
-
</div>
|
|
98
|
-
)}
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
</footer>
|
|
102
|
-
);
|
|
9
|
+
switch (props.footerTemplate) {
|
|
10
|
+
case 'template_one':
|
|
11
|
+
ModuleComponent = loadable(() => import('./variants/template-one'));
|
|
12
|
+
return <ModuleComponent {...props} />;
|
|
13
|
+
case 'template_two':
|
|
14
|
+
ModuleComponent = loadable(() => import('./variants/template-two'));
|
|
15
|
+
return <ModuleComponent {...props} />;
|
|
16
|
+
case 'template_three':
|
|
17
|
+
ModuleComponent = loadable(() => import('./variants/template-three'));
|
|
18
|
+
return <ModuleComponent {...props} />;
|
|
19
|
+
default:
|
|
20
|
+
ModuleComponent = loadable(() => import('./variants/template-one'));
|
|
21
|
+
return <ModuleComponent {...props} />;
|
|
22
|
+
}
|
|
103
23
|
};
|
|
104
24
|
|
|
105
|
-
const
|
|
25
|
+
const Footer = (props) => {
|
|
106
26
|
const helpText = `
|
|
107
27
|
<p>
|
|
108
28
|
Gambling can be addictive, please play responsibly.
|
|
@@ -118,7 +38,6 @@ const FooterProps = (props) => {
|
|
|
118
38
|
</a>
|
|
119
39
|
in order to get help.
|
|
120
40
|
</p>`;
|
|
121
|
-
const phoneNum = '- 89 241 5401';
|
|
122
41
|
|
|
123
42
|
const footerLogos = getExtraField(props.section?.extra_fields, 'logos');
|
|
124
43
|
|
|
@@ -140,6 +59,7 @@ const FooterProps = (props) => {
|
|
|
140
59
|
};
|
|
141
60
|
|
|
142
61
|
props = {
|
|
62
|
+
...props,
|
|
143
63
|
showLinks: props.template !== 'ppc',
|
|
144
64
|
copyrightDisclaimer: getExtraField(props.section?.extra_fields, 'copyright_disclaimer'),
|
|
145
65
|
footerLogos: props.page?.page?.responsibleGaming?.length ? getFooterLogos() : footerLogos,
|
|
@@ -154,33 +74,11 @@ const FooterProps = (props) => {
|
|
|
154
74
|
dmcaWidth: 100,
|
|
155
75
|
dmcaHeight: 30,
|
|
156
76
|
securityIcon: '../../../images/security.svg',
|
|
157
|
-
helpText
|
|
158
|
-
phoneNum,
|
|
159
|
-
...props,
|
|
77
|
+
helpText,
|
|
78
|
+
phoneNum: getExtraField(props.section?.extra_fields, 'helpline') || null,
|
|
160
79
|
};
|
|
161
80
|
|
|
162
|
-
return
|
|
81
|
+
return footerContent(props);
|
|
163
82
|
};
|
|
164
|
-
export default FooterProps;
|
|
165
83
|
|
|
166
|
-
|
|
167
|
-
footerLogos: PropTypes.shape({}),
|
|
168
|
-
footerMenu: PropTypes.shape({
|
|
169
|
-
children: PropTypes.shape([]),
|
|
170
|
-
}),
|
|
171
|
-
copyrightDisclaimer: PropTypes.string,
|
|
172
|
-
showLinks: PropTypes.bool,
|
|
173
|
-
asSeenOn: PropTypes.shape({}),
|
|
174
|
-
gamblingText: PropTypes.string,
|
|
175
|
-
socialIcons: PropTypes.shape({}),
|
|
176
|
-
hasFooterLinks: PropTypes.bool,
|
|
177
|
-
hasDisclaimer: PropTypes.bool,
|
|
178
|
-
showCopyright: PropTypes.bool,
|
|
179
|
-
helpText: PropTypes.string,
|
|
180
|
-
phoneNum: PropTypes.string,
|
|
181
|
-
logo: PropTypes.string,
|
|
182
|
-
dmcaImage: PropTypes.string,
|
|
183
|
-
dmcaWidth: PropTypes.number,
|
|
184
|
-
dmcaHeight: PropTypes.number,
|
|
185
|
-
securityIcon: PropTypes.string,
|
|
186
|
-
};
|
|
84
|
+
export default Footer;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import loadable from '@loadable/component';
|
|
5
|
+
import { copyrightText } from '../../../../../helpers/getters';
|
|
6
|
+
import LinkList from '../../../link-list';
|
|
7
|
+
import Disclaimer from '../../../../atoms/disclaimer';
|
|
8
|
+
import FooterHotline from '../../../../atoms/footer/hotline';
|
|
9
|
+
import FooterLicense from '../../../../atoms/footer/license';
|
|
10
|
+
import styles from './template-one.module.scss';
|
|
11
|
+
|
|
12
|
+
const TemplateOne = ({
|
|
13
|
+
footerLogos,
|
|
14
|
+
footerMenu,
|
|
15
|
+
copyrightDisclaimer,
|
|
16
|
+
showLinks,
|
|
17
|
+
asSeenOn,
|
|
18
|
+
gamblingText,
|
|
19
|
+
socialIcons,
|
|
20
|
+
hasFooterLinks,
|
|
21
|
+
hasDisclaimer,
|
|
22
|
+
showCopyright,
|
|
23
|
+
helpText,
|
|
24
|
+
phoneNum,
|
|
25
|
+
logo,
|
|
26
|
+
dmcaImage,
|
|
27
|
+
dmcaWidth,
|
|
28
|
+
dmcaHeight,
|
|
29
|
+
securityIcon,
|
|
30
|
+
}) => {
|
|
31
|
+
const AsSeenOn = asSeenOn ? loadable(() => import('../../../../atoms/footer/as-seen-on')) : null;
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<footer>
|
|
35
|
+
{AsSeenOn && <AsSeenOn asSeenOn={asSeenOn} template="templateOne" />}
|
|
36
|
+
<div
|
|
37
|
+
className={`${styles?.footer || ''} ${styles?.templateOne || ''}
|
|
38
|
+
${hasFooterLinks && styles[hasFooterLinks] ? styles.hasFooterLinks || '' : ''}`}
|
|
39
|
+
>
|
|
40
|
+
{footerMenu && showLinks && (
|
|
41
|
+
<div className={styles?.topPart || ''}>
|
|
42
|
+
{footerMenu && showLinks && (
|
|
43
|
+
<div className={styles?.links || ''}>
|
|
44
|
+
<LinkList lists={footerMenu} gtmClass="mobile-menu-gtm" />
|
|
45
|
+
</div>
|
|
46
|
+
)}
|
|
47
|
+
<FooterLicense
|
|
48
|
+
gamblingText={gamblingText}
|
|
49
|
+
socialIcons={socialIcons}
|
|
50
|
+
template="templateOne"
|
|
51
|
+
logo={logo}
|
|
52
|
+
securityIcon={securityIcon}
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
)}
|
|
56
|
+
|
|
57
|
+
{(helpText || phoneNum) && (
|
|
58
|
+
<FooterHotline
|
|
59
|
+
showAsSeen={false}
|
|
60
|
+
helpText={helpText}
|
|
61
|
+
phoneNum={phoneNum}
|
|
62
|
+
template="templateOne"
|
|
63
|
+
/>
|
|
64
|
+
)}
|
|
65
|
+
|
|
66
|
+
<div className={styles?.bottomPart || ''}>
|
|
67
|
+
{copyrightDisclaimer && (
|
|
68
|
+
<div
|
|
69
|
+
className={styles?.copyrightDisclaimer || ''}
|
|
70
|
+
// eslint-disable-next-line react/no-danger
|
|
71
|
+
dangerouslySetInnerHTML={{ __html: copyrightDisclaimer }}
|
|
72
|
+
/>
|
|
73
|
+
)}
|
|
74
|
+
{showCopyright && <p className={styles?.copyrightText || ''}>{copyrightText()}</p>}
|
|
75
|
+
|
|
76
|
+
{(footerLogos || hasDisclaimer) && (
|
|
77
|
+
<div className={styles?.logos || ''}>
|
|
78
|
+
{footerLogos && (
|
|
79
|
+
<LinkList
|
|
80
|
+
showListTitle={false}
|
|
81
|
+
imageOnly
|
|
82
|
+
singleList
|
|
83
|
+
lists={footerLogos}
|
|
84
|
+
gtmClass="mobile-menu-gtm logo-cta"
|
|
85
|
+
width={130}
|
|
86
|
+
height={140}
|
|
87
|
+
/>
|
|
88
|
+
)}
|
|
89
|
+
{hasDisclaimer && (
|
|
90
|
+
<Disclaimer
|
|
91
|
+
loading="lazy"
|
|
92
|
+
dmcaImage={dmcaImage}
|
|
93
|
+
imgWidth={dmcaWidth}
|
|
94
|
+
imgHeight={dmcaHeight}
|
|
95
|
+
/>
|
|
96
|
+
)}
|
|
97
|
+
</div>
|
|
98
|
+
)}
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</footer>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
export default TemplateOne;
|
|
105
|
+
|
|
106
|
+
TemplateOne.propTypes = {
|
|
107
|
+
footerLogos: PropTypes.shape({}),
|
|
108
|
+
footerMenu: PropTypes.shape({
|
|
109
|
+
children: PropTypes.shape([]),
|
|
110
|
+
}),
|
|
111
|
+
copyrightDisclaimer: PropTypes.string,
|
|
112
|
+
showLinks: PropTypes.bool,
|
|
113
|
+
asSeenOn: PropTypes.shape({}),
|
|
114
|
+
gamblingText: PropTypes.string,
|
|
115
|
+
socialIcons: PropTypes.shape({}),
|
|
116
|
+
hasFooterLinks: PropTypes.bool,
|
|
117
|
+
hasDisclaimer: PropTypes.bool,
|
|
118
|
+
showCopyright: PropTypes.bool,
|
|
119
|
+
helpText: PropTypes.string,
|
|
120
|
+
phoneNum: PropTypes.string,
|
|
121
|
+
logo: PropTypes.string,
|
|
122
|
+
dmcaImage: PropTypes.string,
|
|
123
|
+
dmcaWidth: PropTypes.number,
|
|
124
|
+
dmcaHeight: PropTypes.number,
|
|
125
|
+
securityIcon: PropTypes.string,
|
|
126
|
+
};
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
|
|
10
10
|
import Footer from '.';
|
|
11
11
|
import { sampleFooter } from '~tests/factories/sections/footer.factory';
|
|
12
|
-
import mlogo from '
|
|
12
|
+
import mlogo from '../../../../../../static/images/dmca.png';
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
15
|
title: 'Theme/Molecules/Footer',
|