gatsby-matrix-theme 2.1.2 → 2.2.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.
- package/.storybook/main.js +1 -0
- package/CHANGELOG.md +46 -0
- package/jest.config.js +1 -0
- package/package.json +2 -2
- package/src/components/atoms/cards/article-card/index.js +9 -6
- package/src/components/atoms/cards/author-card/index.js +6 -1
- package/src/components/atoms/cards/base-card/index.js +1 -1
- package/src/components/atoms/cards/game-card/index.js +9 -6
- package/src/components/atoms/cards/operator-card/index.js +14 -8
- package/src/components/atoms/cards/payment-method-card/index.js +11 -9
- package/src/components/atoms/cards/popup-card/index.js +2 -3
- package/src/components/atoms/cards/popup-card/popup-card.stories.js +0 -10
- package/src/components/atoms/cards/software-provider-card/index.js +10 -9
- package/src/components/atoms/link-menu/index.js +1 -1
- package/src/components/atoms/operator-bonuses/index.js +10 -7
- package/src/components/atoms/search/autocomplete/article.js +1 -1
- package/src/components/atoms/search/autocomplete/game.js +1 -1
- package/src/components/atoms/search/autocomplete/operator.js +1 -1
- package/src/components/atoms/search/autocomplete/payment_methods.js +1 -1
- package/src/components/atoms/search/autocomplete/software_provider.js +1 -1
- package/src/components/atoms/table/banking/index.js +24 -20
- package/src/components/atoms/table/column/index.js +2 -5
- package/src/components/atoms/table/staticColumn/index.js +28 -33
- package/src/components/molecules/faq/index.js +1 -1
- package/src/components/molecules/game-iframe/index.js +6 -1
- package/src/components/molecules/game-score-gauge/game-score-gauge.stories.js +7 -12
- package/src/components/molecules/game-score-gauge/index.js +4 -2
- package/src/components/molecules/info-grid/index.js +1 -0
- package/src/components/molecules/newsletter/index.js +1 -0
- package/src/components/molecules/newsletter/newsletter.stories.js +106 -112
- package/src/components/molecules/newsletter-optin/index.js +7 -7
- package/src/components/molecules/newsletter-optin/newsletter-optin.stories.js +79 -80
- package/src/components/molecules/operator-summary/index.js +8 -2
- package/src/components/molecules/small-welcome-bonus/index.js +19 -6
- package/src/components/molecules/small-welcome-bonus/small-welcome-bonus.stories.js +49 -53
- package/src/components/molecules/toplist/row/variant-one.js +26 -10
- package/src/components/organisms/footer-navigation/index.js +9 -1
- package/src/components/organisms/popup/index.js +6 -5
- package/src/components/organisms/popup/popup.stories.js +0 -10
- package/src/components/organisms/toplist/comparison-table/index.js +11 -13
- package/src/components/organisms/toplist/index.js +2 -4
- package/src/components/organisms/toplist/list/index.js +4 -5
- package/src/gatsby-core-theme/components/atoms/module-title/index.js +5 -8
- package/src/gatsby-core-theme/components/atoms/not-found/index.js +24 -0
- package/src/gatsby-core-theme/components/atoms/not-found/not-found.module.scss +17 -0
- package/src/gatsby-core-theme/components/atoms/spotlights/index.js +25 -8
- package/src/gatsby-core-theme/components/molecules/content/content.module.scss +73 -16
- package/src/gatsby-core-theme/components/molecules/content/index.js +2 -0
- package/src/gatsby-core-theme/components/molecules/footer/index.js +5 -1
- package/src/gatsby-core-theme/components/molecules/main/index.js +6 -1
- package/src/gatsby-core-theme/components/molecules/module/index.js +1 -3
- package/src/gatsby-core-theme/components/molecules/search/index.js +26 -3
- package/src/gatsby-core-theme/components/organisms/anchor/anchor.module.scss +5 -1
- package/src/gatsby-core-theme/components/organisms/anchor/index.js +11 -2
- package/src/gatsby-core-theme/components/organisms/carousel/index.js +17 -6
- package/src/gatsby-core-theme/components/organisms/navigation/index.js +2 -2
- package/src/gatsby-core-theme/components/organisms/search/index.js +2 -1
- package/src/gatsby-core-theme/components/pages/body/index.js +14 -9
- package/src/gatsby-core-theme/components/pages/search/index.js +79 -74
- package/src/hooks/tabs/index.js +6 -4
- package/src/hooks/tabs/tab/tab-list.js +4 -1
- package/src/hooks/tabs/tab/tab.js +37 -28
- package/storybook/public/{0.a9b647e1.iframe.bundle.js → 0.a5c4cf9f.iframe.bundle.js} +1 -1
- package/storybook/public/{1.94c59b7e.iframe.bundle.js → 1.b2b72c50.iframe.bundle.js} +1 -1
- package/storybook/public/{10.727dd594.iframe.bundle.js → 10.502b5ac2.iframe.bundle.js} +1 -1
- package/storybook/public/{11.2e850035.iframe.bundle.js → 11.30535586.iframe.bundle.js} +1 -1
- package/storybook/public/{5.fed35abd.iframe.bundle.js → 5.66b5b921.iframe.bundle.js} +3 -3
- package/storybook/public/{5.fed35abd.iframe.bundle.js.LICENSE.txt → 5.66b5b921.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook/public/5.66b5b921.iframe.bundle.js.map +1 -0
- package/storybook/public/{6.a63e093c.iframe.bundle.js → 6.89431426.iframe.bundle.js} +1 -1
- package/storybook/public/{7.4996d626.iframe.bundle.js → 7.a53e817b.iframe.bundle.js} +1 -1
- package/storybook/public/8.e043e6dc.iframe.bundle.js +3 -0
- package/storybook/public/{8.f4491507.iframe.bundle.js.LICENSE.txt → 8.e043e6dc.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook/public/8.e043e6dc.iframe.bundle.js.map +1 -0
- package/storybook/public/{9.3097c14c.iframe.bundle.js → 9.eba0e7c0.iframe.bundle.js} +1 -1
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.c07025f4.iframe.bundle.js +1 -0
- package/storybook/public/{runtime~main.941ed6de.iframe.bundle.js → runtime~main.c4f3a4d6.iframe.bundle.js} +1 -1
- package/storybook/public/vendors~main.8050786b.iframe.bundle.js +7 -0
- package/storybook/public/{vendors~main.f3d8ec5b.iframe.bundle.js.LICENSE.txt → vendors~main.8050786b.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook/public/vendors~main.8050786b.iframe.bundle.js.map +1 -0
- package/src/gatsby-core-theme/pages/404/index.js +0 -66
- package/storybook/public/5.fed35abd.iframe.bundle.js.map +0 -1
- package/storybook/public/8.f4491507.iframe.bundle.js +0 -3
- package/storybook/public/8.f4491507.iframe.bundle.js.map +0 -1
- package/storybook/public/main.920f3ab1.iframe.bundle.js +0 -1
- package/storybook/public/vendors~main.f3d8ec5b.iframe.bundle.js +0 -7
- package/storybook/public/vendors~main.f3d8ec5b.iframe.bundle.js.map +0 -1
|
@@ -68,7 +68,7 @@ const SearchForm = ({ className, searchIcon, iconWidth = 24, iconHeight = 24 })
|
|
|
68
68
|
type="button"
|
|
69
69
|
aria-label="Search"
|
|
70
70
|
onClick={handleOnSearchIconClick}
|
|
71
|
-
className={`${styles.searchButton} ${showSearch && styles.active}`}
|
|
71
|
+
className={`${styles.searchButton} ${showSearch && styles.active} search-gtm btn-cta`}
|
|
72
72
|
>
|
|
73
73
|
{searchIcon === null ? (
|
|
74
74
|
<FaSearch />
|
|
@@ -92,6 +92,7 @@ const SearchForm = ({ className, searchIcon, iconWidth = 24, iconHeight = 24 })
|
|
|
92
92
|
autoComplete: true,
|
|
93
93
|
sort: true,
|
|
94
94
|
limit: 3,
|
|
95
|
+
showViewResultsText: false,
|
|
95
96
|
}}
|
|
96
97
|
>
|
|
97
98
|
{(item) => (
|
|
@@ -24,6 +24,8 @@ function Body({ pageContext }) {
|
|
|
24
24
|
const footerNavigationData = pageContext?.marketSections?.footer_navigation || null;
|
|
25
25
|
const isHomePage = pageContext?.page && pageContext?.page.path === '/';
|
|
26
26
|
const pageType = pageContext.page.type;
|
|
27
|
+
const is404 = pageContext.page.path.includes('404');
|
|
28
|
+
|
|
27
29
|
const Popup = pageContext?.marketSections?.popup
|
|
28
30
|
? loadable(() => import(`../../../../components/organisms/popup`))
|
|
29
31
|
: null;
|
|
@@ -42,12 +44,13 @@ function Body({ pageContext }) {
|
|
|
42
44
|
const status = pageContext.page.relation?.status;
|
|
43
45
|
|
|
44
46
|
const hideBanner = status === 'inactive' || status === 'coming_soon';
|
|
45
|
-
const { template
|
|
47
|
+
const { template } = pageContext.page;
|
|
46
48
|
|
|
47
49
|
const popupData = pageContext?.marketSections?.popup?.modules?.find((m) => m.name === 'top_list');
|
|
48
|
-
const FooterNavigation =
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
const FooterNavigation =
|
|
51
|
+
footerNavigationData && pageType !== 'operator'
|
|
52
|
+
? loadable(() => import(`../../../../components/organisms/footer-navigation`))
|
|
53
|
+
: null;
|
|
51
54
|
|
|
52
55
|
return (
|
|
53
56
|
<>
|
|
@@ -55,7 +58,6 @@ function Body({ pageContext }) {
|
|
|
55
58
|
<Navigation
|
|
56
59
|
template={template}
|
|
57
60
|
section={navigation}
|
|
58
|
-
translations={translations}
|
|
59
61
|
searchIcon="../../../../../../images/search.svg"
|
|
60
62
|
menu="main_menu"
|
|
61
63
|
options={{
|
|
@@ -76,7 +78,7 @@ function Body({ pageContext }) {
|
|
|
76
78
|
<ContactUs page={pageContext} />
|
|
77
79
|
) : (
|
|
78
80
|
<>
|
|
79
|
-
{!isSearch && <Header section={pageContext} />}
|
|
81
|
+
{!isSearch && !is404 && <Header section={pageContext} />}
|
|
80
82
|
{main && <Main section={main} page={pageContext.page} />}
|
|
81
83
|
{pageType === 'operator' && !hideBanner && (
|
|
82
84
|
<OperatorBanner
|
|
@@ -114,10 +116,14 @@ function Body({ pageContext }) {
|
|
|
114
116
|
<p>
|
|
115
117
|
We use cookies in order to optimise our site and improve your experience with us. By using
|
|
116
118
|
the site you consent to our
|
|
117
|
-
<a href="/cookies">
|
|
119
|
+
<a href="/cookies" className="cookie-consent-gtm">
|
|
120
|
+
{' '}
|
|
121
|
+
Cookie Policy
|
|
122
|
+
</a>
|
|
123
|
+
.
|
|
118
124
|
</p>
|
|
119
125
|
</CookieConsent>
|
|
120
|
-
{Popup && popupData && <Popup module={popupData}
|
|
126
|
+
{Popup && popupData && <Popup module={popupData} />}
|
|
121
127
|
</>
|
|
122
128
|
);
|
|
123
129
|
}
|
|
@@ -130,7 +136,6 @@ Body.propTypes = {
|
|
|
130
136
|
type: PropTypes.string,
|
|
131
137
|
path: PropTypes.string,
|
|
132
138
|
template: PropTypes.string,
|
|
133
|
-
translations: PropTypes.shape({}),
|
|
134
139
|
relation: PropTypes.shape({
|
|
135
140
|
status: PropTypes.string,
|
|
136
141
|
logo_url: PropTypes.string,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/* eslint-disable react/forbid-prop-types */
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import Breadcrumbs from 'gatsby-core-theme/src/components/atoms/breadcrumbs';
|
|
5
5
|
import Search from 'gatsby-core-theme/src/components/molecules/search';
|
|
6
6
|
import moduleStyles from 'gatsby-core-theme/src/components/molecules/module/module.module.scss';
|
|
7
7
|
import { translate } from 'gatsby-core-theme/src/helpers/getters';
|
|
8
|
+
import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
|
|
8
9
|
import CardArticle from '../../../../components/atoms/cards/article-card';
|
|
9
10
|
import CardGame from '../../../../components/atoms/cards/game-card';
|
|
10
11
|
import CardOperator from '../../../../components/atoms/cards/operator-card';
|
|
@@ -12,85 +13,89 @@ import PaymentMethods from '../../../../components/atoms/cards/payment-method-ca
|
|
|
12
13
|
import SoftwareProvider from '../../../../components/atoms/cards/software-provider-card';
|
|
13
14
|
import styles from './search.module.scss';
|
|
14
15
|
|
|
15
|
-
const SearchContent = ({ page }) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
const SearchContent = ({ page }) => {
|
|
17
|
+
const { translations } = useContext(Context) || {};
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className={`${styles.searchPage} ${moduleStyles.module} module`}>
|
|
21
|
+
{page.path && <Breadcrumbs page={page} />}
|
|
22
|
+
<Search
|
|
23
|
+
page={page}
|
|
24
|
+
searchIcon="../../../../../../images/search.svg"
|
|
25
|
+
pageSearchOptions={{
|
|
26
|
+
searchTitle: translate(translations, 'search_results_for', 'Search Results for:'),
|
|
27
|
+
useArchive: true,
|
|
28
|
+
archiveOptions: {
|
|
29
|
+
titles: [
|
|
30
|
+
{ type: 'operator', title: translate(translations, 'casino', 'Casino') },
|
|
31
|
+
{ type: 'game', title: translate(translations, 'slots', 'Slots') },
|
|
32
|
+
{ type: 'article', title: translate(translations, 'news', 'News') },
|
|
33
|
+
{
|
|
34
|
+
type: 'payment_method',
|
|
35
|
+
title: translate(translations, 'payment_method', 'Payment method'),
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: 'software_provider',
|
|
39
|
+
title: translate(translations, 'software_provider', 'Software Provider'),
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
includeOptions: {
|
|
43
|
+
desktop_num_of_columns: '3',
|
|
44
|
+
mobile_num_of_columns: '1',
|
|
45
|
+
tablet_num_of_columns: '3',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
tabs: true,
|
|
49
|
+
tabsOptions: { showAll: translate(translations, 'all', 'All'), tabsAlign: 'left' },
|
|
50
|
+
sort: [
|
|
51
|
+
{
|
|
52
|
+
name: translate(translations, 'most_relevant', 'Most Relevant'),
|
|
53
|
+
field: 'id',
|
|
54
|
+
type: 'number',
|
|
55
|
+
},
|
|
29
56
|
{
|
|
30
|
-
|
|
31
|
-
|
|
57
|
+
name: translate(translations, 'latest', 'Latest'),
|
|
58
|
+
field: 'created_at',
|
|
59
|
+
type: 'date',
|
|
32
60
|
},
|
|
33
61
|
{
|
|
34
|
-
|
|
35
|
-
|
|
62
|
+
name: translate(translations, 'by_title', 'By Title'),
|
|
63
|
+
field: 'title',
|
|
64
|
+
type: 'string',
|
|
36
65
|
},
|
|
37
66
|
],
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
67
|
+
loadMore: {
|
|
68
|
+
label: translate(translations, 'show_more', 'Show more'),
|
|
69
|
+
limit: 3,
|
|
70
|
+
increment: 6,
|
|
71
|
+
usePrimaryButton: false,
|
|
72
|
+
useInvertColors: true,
|
|
42
73
|
},
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
type
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
useInvertColors: true,
|
|
69
|
-
},
|
|
70
|
-
}}
|
|
71
|
-
>
|
|
72
|
-
{(item) => (
|
|
73
|
-
<>
|
|
74
|
-
<div type="operator">
|
|
75
|
-
<CardOperator item={item} />
|
|
76
|
-
</div>
|
|
77
|
-
<div type="game">
|
|
78
|
-
<CardGame item={item} />
|
|
79
|
-
</div>
|
|
80
|
-
<div type="article">
|
|
81
|
-
<CardArticle item={item} />
|
|
82
|
-
</div>
|
|
83
|
-
<div type="payment_method">
|
|
84
|
-
<PaymentMethods item={item} />
|
|
85
|
-
</div>
|
|
86
|
-
<div type="software_provider">
|
|
87
|
-
<SoftwareProvider item={item} />
|
|
88
|
-
</div>
|
|
89
|
-
</>
|
|
90
|
-
)}
|
|
91
|
-
</Search>
|
|
92
|
-
</div>
|
|
93
|
-
);
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
{(item) => (
|
|
77
|
+
<>
|
|
78
|
+
<div type="operator">
|
|
79
|
+
<CardOperator item={item} />
|
|
80
|
+
</div>
|
|
81
|
+
<div type="game">
|
|
82
|
+
<CardGame item={item} />
|
|
83
|
+
</div>
|
|
84
|
+
<div type="article">
|
|
85
|
+
<CardArticle item={item} />
|
|
86
|
+
</div>
|
|
87
|
+
<div type="payment_method">
|
|
88
|
+
<PaymentMethods item={item} />
|
|
89
|
+
</div>
|
|
90
|
+
<div type="software_provider">
|
|
91
|
+
<SoftwareProvider item={item} />
|
|
92
|
+
</div>
|
|
93
|
+
</>
|
|
94
|
+
)}
|
|
95
|
+
</Search>
|
|
96
|
+
</div>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
94
99
|
|
|
95
100
|
SearchContent.propTypes = {
|
|
96
101
|
page: PropTypes.shape({
|
package/src/hooks/tabs/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useContext, useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { translate } from 'gatsby-core-theme/src/helpers/getters';
|
|
4
|
+
import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
|
|
4
5
|
import TabList from './tab/tab-list';
|
|
5
6
|
import styles from './tabs.module.scss';
|
|
6
7
|
|
|
@@ -14,7 +15,7 @@ const Tabs = ({
|
|
|
14
15
|
activeTabClass = '',
|
|
15
16
|
HeaderComp,
|
|
16
17
|
headerClass = '',
|
|
17
|
-
|
|
18
|
+
gtmClass = '',
|
|
18
19
|
}) => {
|
|
19
20
|
const showAllTabId = `${showAll}_0`;
|
|
20
21
|
const showTabs = children.length > 1;
|
|
@@ -22,6 +23,7 @@ const Tabs = ({
|
|
|
22
23
|
showAll ? showAllTabId : `${children[0].props.label}_0`
|
|
23
24
|
);
|
|
24
25
|
const CustomTag = `${module?.module_title_tag}`;
|
|
26
|
+
const { translations } = useContext(Context) || {};
|
|
25
27
|
const monthNames = [
|
|
26
28
|
'January',
|
|
27
29
|
'February',
|
|
@@ -104,7 +106,7 @@ const Tabs = ({
|
|
|
104
106
|
showAll={showAll}
|
|
105
107
|
alignRight={tabsAlign === 'right'}
|
|
106
108
|
module={module}
|
|
107
|
-
|
|
109
|
+
gtmClass={gtmClass}
|
|
108
110
|
/>
|
|
109
111
|
)}
|
|
110
112
|
{HeaderComp && <div className={styles.headerComp}>{HeaderComp}</div>}
|
|
@@ -139,7 +141,7 @@ Tabs.propTypes = {
|
|
|
139
141
|
title: PropTypes.string,
|
|
140
142
|
module: PropTypes.shape({}),
|
|
141
143
|
siteName: PropTypes.string,
|
|
142
|
-
|
|
144
|
+
gtmClass: PropTypes.string,
|
|
143
145
|
};
|
|
144
146
|
|
|
145
147
|
export default Tabs;
|
|
@@ -14,6 +14,7 @@ const TabList = ({
|
|
|
14
14
|
activeTabClass = '',
|
|
15
15
|
showAll,
|
|
16
16
|
alignRight = false,
|
|
17
|
+
gtmClass = '',
|
|
17
18
|
}) => {
|
|
18
19
|
const [tabItems, setTabItems] = useState(items);
|
|
19
20
|
|
|
@@ -38,7 +39,7 @@ const TabList = ({
|
|
|
38
39
|
<div className={`${styles.tabList} ${alignRight && styles.right}`}>
|
|
39
40
|
<button
|
|
40
41
|
ref={filterBtn}
|
|
41
|
-
className={styles.select}
|
|
42
|
+
className={`${styles.select} ${gtmClass} btn-cta`}
|
|
42
43
|
type="button"
|
|
43
44
|
onClick={showDropdown}
|
|
44
45
|
data-id="select-button"
|
|
@@ -59,6 +60,7 @@ const TabList = ({
|
|
|
59
60
|
label={label}
|
|
60
61
|
onClick={onClick}
|
|
61
62
|
toggleDropdown={showDropdown}
|
|
63
|
+
gtmClass={gtmClass}
|
|
62
64
|
/>
|
|
63
65
|
);
|
|
64
66
|
})}
|
|
@@ -74,6 +76,7 @@ TabList.propTypes = {
|
|
|
74
76
|
activeTab: PropTypes.string,
|
|
75
77
|
activeTabClass: PropTypes.string,
|
|
76
78
|
alignRight: PropTypes.bool,
|
|
79
|
+
gtmClass: PropTypes.string,
|
|
77
80
|
};
|
|
78
81
|
|
|
79
82
|
export default TabList;
|
|
@@ -2,39 +2,48 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styles from './tab.module.scss';
|
|
4
4
|
|
|
5
|
-
const Tab = ({
|
|
6
|
-
|
|
5
|
+
const Tab = ({
|
|
6
|
+
label,
|
|
7
|
+
onClick,
|
|
8
|
+
activeTab,
|
|
9
|
+
activeTabClass = '',
|
|
10
|
+
tabId,
|
|
11
|
+
toggleDropdown,
|
|
12
|
+
gtmClass = '',
|
|
13
|
+
}) => {
|
|
14
|
+
let className = '';
|
|
7
15
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
16
|
+
if (activeTab === tabId) {
|
|
17
|
+
if (activeTabClass !== '') {
|
|
18
|
+
className = ` ${styles[activeTabClass]}`;
|
|
19
|
+
} else {
|
|
20
|
+
className = ` ${styles.active}`;
|
|
14
21
|
}
|
|
22
|
+
}
|
|
15
23
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
return (
|
|
25
|
+
<li className={styles.tabListItem}>
|
|
26
|
+
<button
|
|
27
|
+
className={`${className} ${gtmClass} tabs-menu-gtm btn-cta`}
|
|
28
|
+
type="button"
|
|
29
|
+
onClick={() => {
|
|
30
|
+
onClick(tabId);
|
|
31
|
+
toggleDropdown();
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
{label}
|
|
35
|
+
</button>
|
|
36
|
+
</li>
|
|
37
|
+
);
|
|
30
38
|
};
|
|
31
39
|
Tab.propTypes = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
onClick: PropTypes.func,
|
|
41
|
+
toggleDropdown: PropTypes.func,
|
|
42
|
+
activeTab: PropTypes.string,
|
|
43
|
+
activeTabClass: PropTypes.string,
|
|
44
|
+
tabId: PropTypes.string,
|
|
45
|
+
label: PropTypes.string,
|
|
46
|
+
gtmClass: PropTypes.string,
|
|
38
47
|
};
|
|
39
48
|
|
|
40
49
|
export default Tab;
|