gatsby-matrix-theme 40.0.19 → 40.0.21
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/.ci.yml +4 -5
- package/CHANGELOG.md +40 -0
- package/jest.config.js +1 -1
- package/package.json +2 -2
- package/src/components/atoms/cards/article-card/template-one/index.js +2 -4
- package/src/components/atoms/cards/article-card/template-one/template-one.testtt.js +51 -0
- package/src/components/atoms/cards/game-cards/template-five/index.js +4 -5
- package/src/components/atoms/cards/game-cards/template-four/index.js +4 -5
- package/src/components/atoms/cards/game-cards/template-one/index.js +1 -6
- package/src/components/atoms/cards/game-cards/template-three/index.js +4 -5
- package/src/components/atoms/cards/game-cards/template-two/index.js +4 -5
- package/src/components/atoms/cards/operator-card/template-four/index.js +2 -4
- package/src/components/atoms/cards/operator-card/template-four/template-four.test.js +31 -31
- package/src/components/atoms/cards/operator-card/template-one/index.js +4 -7
- package/src/components/atoms/cards/operator-card/template-one/template-one.test.js +31 -31
- package/src/components/atoms/cards/operator-card/template-three/index.js +4 -7
- package/src/components/atoms/cards/operator-card/template-three/template-three.test.js +31 -31
- package/src/components/atoms/cards/operator-card/template-two/index.js +4 -8
- package/src/components/atoms/cards/operator-card/template-two/template-two.test.js +31 -31
- package/src/components/atoms/cards/payment-method/template-one/index.js +2 -5
- package/src/components/atoms/cards/payment-method/template-three/index.js +4 -6
- package/src/components/atoms/footer/hotline/index.js +21 -25
- package/src/components/atoms/ratings/index.js +1 -1
- package/src/components/molecules/cookie-modal/index.js +4 -1
- package/src/components/molecules/header/variants/operator/template-five/index.js +1 -1
- package/src/components/molecules/header/variants/operator/template-four/index.js +2 -4
- package/src/components/molecules/header/variants/operator/template-one-two/index.js +2 -4
- package/src/components/molecules/header/variants/operator/template-three/index.js +2 -4
- package/src/components/molecules/operator-details/index.js +3 -21
- package/src/components/molecules/operator-details/operator-details.test.js +16 -16
- package/src/components/molecules/wagering-calculator/index.js +3 -7
- package/src/components/molecules/wagering-calculator/wagering-calculator.test.js +11 -11
- package/src/components/organisms/cards/index.js +4 -5
- package/src/components/organisms/cards/module-introduction/index.js +4 -8
- package/src/components/organisms/cards/template-one/cards.module.scss +24 -0
- package/src/components/organisms/cards/template-one/index.js +59 -12
- package/src/components/organisms/cards/template-two/index.js +2 -2
- package/src/components/organisms/cards/template-two/item/index.js +11 -9
- package/src/constants/ratings-constant.js +2 -1
- package/src/gatsby-core-theme/components/molecules/floating-area/index.js +21 -17
- package/src/gatsby-core-theme/components/molecules/header/header.module.scss +24 -0
- package/src/gatsby-core-theme/components/molecules/header/header.test.js +1 -15
- package/src/gatsby-core-theme/components/molecules/header/index.js +241 -210
- package/src/gatsby-core-theme/components/molecules/main/index.js +68 -38
- package/src/gatsby-core-theme/components/molecules/module/index.js +117 -65
- package/src/gatsby-core-theme/components/molecules/module/module.module.scss +9 -0
- package/src/gatsby-core-theme/components/molecules/search/index.js +3 -8
- package/src/gatsby-core-theme/components/organisms/cookie-consent/cookie-consent.module.scss +5 -0
- package/src/gatsby-core-theme/components/organisms/toplist/index.js +8 -11
- package/src/gatsby-core-theme/components/pages/body/index.js +20 -32
- package/src/gatsby-core-theme/components/pages/search/index.js +1 -8
- package/src/gatsby-core-theme/hooks/tabs/index.js +9 -10
- package/src/helpers/cards.js +8 -8
- package/storybook/public/177.d172c821.iframe.bundle.js +1 -0
- package/storybook/public/179.cf86fb79.iframe.bundle.js +2 -0
- package/storybook/public/232.0187b657.iframe.bundle.js +1 -0
- package/storybook/public/240.bceabc4d.iframe.bundle.js +1 -0
- package/storybook/public/36.6d7d7dac.iframe.bundle.js +1 -0
- package/storybook/public/395.c1efbb64.iframe.bundle.js +2 -0
- package/storybook/public/395.c1efbb64.iframe.bundle.js.LICENSE.txt +19 -0
- package/storybook/public/420.a736e0a4.iframe.bundle.js +1 -0
- package/storybook/public/441.785aac5c.iframe.bundle.js +1 -0
- package/storybook/public/475.d67cc45e.iframe.bundle.js +1 -0
- package/storybook/public/477.9c72cb2c.iframe.bundle.js +1 -0
- package/storybook/public/504.6c39549e.iframe.bundle.js +1 -0
- package/storybook/public/563.10ed9a30.iframe.bundle.js +1 -0
- package/storybook/public/597.76b11f56.iframe.bundle.js +1 -0
- package/storybook/public/604.9bf212fc.iframe.bundle.js +1 -0
- package/storybook/public/61.24d29b3a.iframe.bundle.js +1 -0
- package/storybook/public/620.006a92ae.iframe.bundle.js +2 -0
- package/storybook/public/631.01156847.iframe.bundle.js +1 -0
- package/storybook/public/672.3058d279.iframe.bundle.js +1 -0
- package/storybook/public/679.4b227ee0.iframe.bundle.js +1 -0
- package/storybook/public/728.ae4470e4.iframe.bundle.js +7 -0
- package/storybook/public/{972.46b935fe.iframe.bundle.js.LICENSE.txt → 728.ae4470e4.iframe.bundle.js.LICENSE.txt} +0 -8
- package/storybook/public/{972.46b935fe.iframe.bundle.js.map → 728.ae4470e4.iframe.bundle.js.map} +1 -1
- package/storybook/public/776.44fd86a4.iframe.bundle.js +1 -0
- package/storybook/public/777.54713435.iframe.bundle.js +1 -0
- package/storybook/public/778.65a1be79.iframe.bundle.js +1 -0
- package/storybook/public/780.3a6a2927.iframe.bundle.js +2 -0
- package/storybook/public/794.abd55b25.iframe.bundle.js +1 -0
- package/storybook/public/796.8a8f559c.iframe.bundle.js +1 -0
- package/storybook/public/854.9fc784ba.iframe.bundle.js +1 -0
- package/storybook/public/909.0e3d61f8.iframe.bundle.js +1 -0
- package/storybook/public/943.bb1590d6.iframe.bundle.js +1 -0
- package/storybook/public/964.10c64556.iframe.bundle.js +1 -0
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.845fe2d1.iframe.bundle.js +1 -0
- package/storybook/public/project.json +1 -1
- package/storybook/public/runtime~main.2fdfdc96.iframe.bundle.js +1 -0
- package/src/components/atoms/cards/article-card/template-one/template-one.test.js +0 -51
- package/src/components/organisms/footer-navigation/footer-navigation.module.scss +0 -63
- package/src/components/organisms/footer-navigation/footer-navigation.stories.js +0 -122
- package/src/components/organisms/footer-navigation/index.js +0 -63
- package/storybook/public/113.10a9116f.iframe.bundle.js +0 -1
- package/storybook/public/127.17fc3e0b.iframe.bundle.js +0 -1
- package/storybook/public/162.d30676dc.iframe.bundle.js +0 -1
- package/storybook/public/172.1e3aefdb.iframe.bundle.js +0 -1
- package/storybook/public/183.b66d2a78.iframe.bundle.js +0 -1
- package/storybook/public/200.d678bbe9.iframe.bundle.js +0 -1
- package/storybook/public/203.52d417b8.iframe.bundle.js +0 -1
- package/storybook/public/225.6dca798a.iframe.bundle.js +0 -2
- package/storybook/public/26.e7520637.iframe.bundle.js +0 -1
- package/storybook/public/274.0e5a096a.iframe.bundle.js +0 -1
- package/storybook/public/283.219e438b.iframe.bundle.js +0 -1
- package/storybook/public/313.f14e679f.iframe.bundle.js +0 -1
- package/storybook/public/326.da0ba286.iframe.bundle.js +0 -1
- package/storybook/public/329.31f288b0.iframe.bundle.js +0 -1
- package/storybook/public/347.9b0cc0b2.iframe.bundle.js +0 -1
- package/storybook/public/357.40e0e31a.iframe.bundle.js +0 -1
- package/storybook/public/377.0129ee10.iframe.bundle.js +0 -1
- package/storybook/public/426.5bbf0dd8.iframe.bundle.js +0 -1
- package/storybook/public/43.44dc45b5.iframe.bundle.js +0 -1
- package/storybook/public/487.04548d26.iframe.bundle.js +0 -1
- package/storybook/public/495.b7d9f489.iframe.bundle.js +0 -1
- package/storybook/public/521.cac47219.iframe.bundle.js +0 -1
- package/storybook/public/555.99d9c86b.iframe.bundle.js +0 -1
- package/storybook/public/567.17326796.iframe.bundle.js +0 -1
- package/storybook/public/590.25fcc3e8.iframe.bundle.js +0 -1
- package/storybook/public/625.4e46db89.iframe.bundle.js +0 -1
- package/storybook/public/658.22cfca07.iframe.bundle.js +0 -1
- package/storybook/public/664.a464a442.iframe.bundle.js +0 -1
- package/storybook/public/687.7bbde896.iframe.bundle.js +0 -1
- package/storybook/public/696.209eab94.iframe.bundle.js +0 -1
- package/storybook/public/713.8662e9a0.iframe.bundle.js +0 -1
- package/storybook/public/725.7f876a32.iframe.bundle.js +0 -2
- package/storybook/public/758.dae33e9e.iframe.bundle.js +0 -1
- package/storybook/public/809.7a44a691.iframe.bundle.js +0 -1
- package/storybook/public/864.8d02059a.iframe.bundle.js +0 -1
- package/storybook/public/866.0e255b9d.iframe.bundle.js +0 -1
- package/storybook/public/871.e3a780ba.iframe.bundle.js +0 -1
- package/storybook/public/907.0521c6f4.iframe.bundle.js +0 -2
- package/storybook/public/907.0521c6f4.iframe.bundle.js.LICENSE.txt +0 -1
- package/storybook/public/919.57aed125.iframe.bundle.js +0 -1
- package/storybook/public/933.e56e01a1.iframe.bundle.js +0 -1
- package/storybook/public/938.f1a4065f.iframe.bundle.js +0 -1
- package/storybook/public/952.09d50df1.iframe.bundle.js +0 -1
- package/storybook/public/97.dab9ed43.iframe.bundle.js +0 -1
- package/storybook/public/972.46b935fe.iframe.bundle.js +0 -7
- package/storybook/public/984.5ce87937.iframe.bundle.js +0 -2
- package/storybook/public/main.e89889b3.iframe.bundle.js +0 -2
- package/storybook/public/main.e89889b3.iframe.bundle.js.LICENSE.txt +0 -1
- package/storybook/public/runtime~main.01b9ad37.iframe.bundle.js +0 -1
- /package/src/gatsby-core-theme/components/{pages/body/body.module.scss → molecules/floating-area/floating-area.module.scss} +0 -0
- /package/storybook/public/{725.7f876a32.iframe.bundle.js.LICENSE.txt → 179.cf86fb79.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook/public/{225.6dca798a.iframe.bundle.js.LICENSE.txt → 620.006a92ae.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook/public/{984.5ce87937.iframe.bundle.js.LICENSE.txt → 780.3a6a2927.iframe.bundle.js.LICENSE.txt} +0 -0
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
3
|
-
import loadable from '@loadable/component';
|
|
4
3
|
import ModuleIntroduction from './module-introduction';
|
|
5
4
|
import SeeMore from '../../atoms/see-more';
|
|
5
|
+
import OperatorsTable from '../../atoms/cards/operators-table';
|
|
6
|
+
import ComparisonTable from '../../atoms/cards/comparison-table';
|
|
7
|
+
import SrcollLayout from './template-two';
|
|
8
|
+
import GridLayout from './template-one';
|
|
6
9
|
|
|
7
10
|
export default function index({ module, page, seeMoreButtonDown = false }) {
|
|
8
11
|
const Component = () => {
|
|
9
12
|
switch (module?.style) {
|
|
10
13
|
case 'stack_table': {
|
|
11
14
|
if (module.cards_page_type === 'operator') {
|
|
12
|
-
const OperatorsTable = loadable(() => import('../../atoms/cards/operators-table'));
|
|
13
15
|
return <OperatorsTable module={module} page={page} />;
|
|
14
16
|
}
|
|
15
17
|
return null;
|
|
16
18
|
}
|
|
17
19
|
case 'comparison_table': {
|
|
18
20
|
if (module.cards_page_type === 'operator') {
|
|
19
|
-
const ComparisonTable = loadable(() => import('../../atoms/cards/comparison-table'));
|
|
20
21
|
return <ComparisonTable module={module} page={page} />;
|
|
21
22
|
}
|
|
22
23
|
return null;
|
|
23
24
|
}
|
|
24
25
|
case 'template_two': {
|
|
25
|
-
const SrcollLayout = loadable(() => import('./template-two'));
|
|
26
26
|
return <SrcollLayout module={module} page={page} />;
|
|
27
27
|
}
|
|
28
28
|
default: {
|
|
29
|
-
const GridLayout = loadable(() => import('./template-one'));
|
|
30
29
|
return <GridLayout module={module} page={page} />;
|
|
31
30
|
}
|
|
32
31
|
}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import loadable from '@loadable/component';
|
|
5
4
|
import { anchorLink } from 'gatsby-core-theme/src/helpers/strings';
|
|
5
|
+
import { removeSymbols } from '../../../../helpers/strings';
|
|
6
|
+
import ModuleIntro from '~molecules/content';
|
|
6
7
|
import styles from './styles.module.scss';
|
|
7
8
|
import ModuleTitle from '../../../../gatsby-core-theme/components/atoms/module-title';
|
|
8
|
-
|
|
9
|
-
import { removeSymbols } from '../../../../helpers/strings';
|
|
10
9
|
import SeeMore from '../../../atoms/see-more';
|
|
11
10
|
|
|
12
11
|
const ModuleIntroduction = ({ module, showSeeMore = false }) => {
|
|
13
12
|
const anchorLabel = module?.anchor_label && removeSymbols(anchorLink(module?.anchor_label));
|
|
14
13
|
|
|
15
|
-
const
|
|
16
|
-
module?.module_introduction && module?.module_introduction !== '<p></p>'
|
|
17
|
-
? loadable(() => import('~molecules/content'))
|
|
18
|
-
: null;
|
|
14
|
+
const showModuleIntro = module?.module_introduction && module?.module_introduction !== '<p></p>';
|
|
19
15
|
|
|
20
16
|
return (
|
|
21
17
|
<div className={ModuleIntro ? '' : styles.noIntroModuleCards}>
|
|
@@ -24,7 +20,7 @@ const ModuleIntroduction = ({ module, showSeeMore = false }) => {
|
|
|
24
20
|
anchorLabel={module.name === 'archive' && anchorLabel}
|
|
25
21
|
showMoreLink={!ModuleIntro}
|
|
26
22
|
/>
|
|
27
|
-
{
|
|
23
|
+
{showModuleIntro && (
|
|
28
24
|
<ModuleIntro
|
|
29
25
|
isModuleIntroduction={module?.module_introduction}
|
|
30
26
|
module={{ value: module?.module_introduction }}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.cardsContainer {
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
4
|
+
|
|
5
|
+
@include min(tablet) {
|
|
6
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@include min(desktop) {
|
|
10
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
11
|
+
}
|
|
12
|
+
column-gap: 0.8rem;
|
|
13
|
+
row-gap: 1rem;
|
|
14
|
+
|
|
15
|
+
@include min(desktop) {
|
|
16
|
+
column-gap: 1.6rem;
|
|
17
|
+
}
|
|
18
|
+
> div {
|
|
19
|
+
margin: 0.4rem 0;
|
|
20
|
+
@include min(desktop) {
|
|
21
|
+
margin: 0.8rem 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,20 +1,67 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
3
3
|
/* eslint-disable react/destructuring-assignment */
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import Card from 'gatsby-core-theme/src/components/organisms/cards/index';
|
|
4
|
+
// import React from 'react';
|
|
5
|
+
// import Card from 'gatsby-core-theme/src/components/organisms/cards/index';
|
|
6
|
+
// import { getCard } from '../../../../helpers/cards';
|
|
7
|
+
|
|
8
|
+
// export default ({ module, page }) => {
|
|
9
|
+
// const customCardComponent = getCard(module?.model_type || module?.cards_page_type);
|
|
10
|
+
|
|
11
|
+
// return (
|
|
12
|
+
// <Card
|
|
13
|
+
// module={module}
|
|
14
|
+
// mobileColumns={1}
|
|
15
|
+
// tabletColumns={2}
|
|
16
|
+
// desktopColumns={3}
|
|
17
|
+
// CustomCardComponent={customCardComponent}
|
|
18
|
+
// pageTemplate={page?.template}
|
|
19
|
+
// />
|
|
20
|
+
// );
|
|
21
|
+
// };
|
|
22
|
+
|
|
23
|
+
/* eslint-disable camelcase */
|
|
24
|
+
import React, { Suspense } from 'react';
|
|
25
|
+
import PropTypes from 'prop-types';
|
|
6
26
|
import { getCard } from '../../../../helpers/cards';
|
|
27
|
+
import styles from './cards.module.scss';
|
|
28
|
+
import Card from '~atoms/cards/default-card';
|
|
29
|
+
import keygen from '~helpers/keygen';
|
|
30
|
+
|
|
31
|
+
const Cards = ({ module, page }) => {
|
|
32
|
+
const CustomCardComponent = getCard(module?.model_type || module?.cards_page_type);
|
|
7
33
|
|
|
8
|
-
export default ({ module, page }) => {
|
|
9
|
-
const customCardComponent = getCard(module?.model_type || module?.cards_page_type);
|
|
10
34
|
return (
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
35
|
+
<div className={styles.cardsContainer}>
|
|
36
|
+
{module.items &&
|
|
37
|
+
module.items.map((item, index) =>
|
|
38
|
+
CustomCardComponent ? (
|
|
39
|
+
<Suspense fallback={<></>}>
|
|
40
|
+
<CustomCardComponent
|
|
41
|
+
key={keygen()}
|
|
42
|
+
featured={module.style === 'featured'}
|
|
43
|
+
item={item}
|
|
44
|
+
type={item.type}
|
|
45
|
+
number={index + 1}
|
|
46
|
+
page={page}
|
|
47
|
+
/>
|
|
48
|
+
</Suspense>
|
|
49
|
+
) : (
|
|
50
|
+
<Card key={keygen()} item={item} />
|
|
51
|
+
)
|
|
52
|
+
)}
|
|
53
|
+
</div>
|
|
19
54
|
);
|
|
20
55
|
};
|
|
56
|
+
|
|
57
|
+
Cards.propTypes = {
|
|
58
|
+
module: PropTypes.shape({
|
|
59
|
+
// eslint-disable-next-line react/forbid-prop-types
|
|
60
|
+
items: PropTypes.arrayOf(PropTypes.object),
|
|
61
|
+
featured_index: PropTypes.number,
|
|
62
|
+
style: PropTypes.string,
|
|
63
|
+
}).isRequired,
|
|
64
|
+
page: PropTypes.shape({}),
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default Cards;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import React, { useRef, useState, useEffect } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import ScrollX from 'gatsby-core-theme/src/hooks/scroll-x';
|
|
6
|
-
import
|
|
6
|
+
import Item from './item';
|
|
7
7
|
import Buttons from './buttons';
|
|
8
8
|
|
|
9
9
|
const CustomCarousel = ({ page, module, noModuleIntro }) => {
|
|
@@ -50,7 +50,7 @@ const CustomCarousel = ({ page, module, noModuleIntro }) => {
|
|
|
50
50
|
<div ref={container}>
|
|
51
51
|
{module.items &&
|
|
52
52
|
module.items.map((item, index) => (
|
|
53
|
-
<
|
|
53
|
+
<Item key={index} index={index} item={item} page={page} module={module} />
|
|
54
54
|
))}
|
|
55
55
|
{showButtons && (
|
|
56
56
|
<Buttons
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable react/forbid-prop-types */
|
|
2
|
-
import React, { memo } from 'react';
|
|
2
|
+
import React, { memo, Suspense } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { getCard } from '../../../../../helpers/cards';
|
|
5
5
|
import keygen from '~helpers/keygen';
|
|
@@ -7,14 +7,16 @@ import keygen from '~helpers/keygen';
|
|
|
7
7
|
const CustomCardComponent = memo(({ module, item, page, index, template = 'template_five' }) => {
|
|
8
8
|
const Compo = getCard(module.model_type || module.cards_page_type, template);
|
|
9
9
|
return (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
<Suspense fallback={<></>}>
|
|
11
|
+
<Compo
|
|
12
|
+
key={keygen()}
|
|
13
|
+
featured={module.style === 'featured'}
|
|
14
|
+
item={item}
|
|
15
|
+
type={item.type}
|
|
16
|
+
number={index + 1}
|
|
17
|
+
page={page}
|
|
18
|
+
/>
|
|
19
|
+
</Suspense>
|
|
18
20
|
);
|
|
19
21
|
});
|
|
20
22
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/* eslint-disable react/react-in-jsx-scope */
|
|
2
|
+
/* eslint-disable import/prefer-default-export */
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating/one-star';
|
|
4
5
|
import { FaStar } from '@react-icons/all-files/fa/FaStar';
|
|
5
6
|
|
|
6
|
-
export
|
|
7
|
+
export const operatorRatings = {
|
|
7
8
|
operator: [
|
|
8
9
|
{
|
|
9
10
|
fieldLabel: 'Overall',
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/* eslint-disable no-case-declarations */
|
|
2
2
|
/* eslint-disable react/no-danger */
|
|
3
|
-
import React, { useState } from 'react';
|
|
3
|
+
import React, { useState, lazy, Suspense } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
6
|
-
import loadable from '@loadable/component';
|
|
7
6
|
import ScrollToTop from '~atoms/scroll-to-top';
|
|
8
7
|
import CookieConsent from '~organisms/cookie-consent';
|
|
9
8
|
import isSticky from '~hooks/stickyOnScroll';
|
|
9
|
+
import styles from './floating-area.module.scss';
|
|
10
10
|
|
|
11
11
|
export default function FloatingArea({
|
|
12
12
|
pageContext,
|
|
13
13
|
template,
|
|
14
|
-
customStyles,
|
|
15
14
|
hideOperatorBanner = false,
|
|
16
15
|
offsetTop = 400,
|
|
17
16
|
}) {
|
|
@@ -28,30 +27,32 @@ export default function FloatingArea({
|
|
|
28
27
|
|
|
29
28
|
const OperatorBanner =
|
|
30
29
|
pageType === 'operator' && !hideBanner && !hideOperatorBanner
|
|
31
|
-
?
|
|
30
|
+
? lazy(() => import(`gatsby-core-theme/src/components/molecules/bonus/template-two`))
|
|
32
31
|
: null;
|
|
33
32
|
|
|
34
33
|
const FooterNavigation =
|
|
35
34
|
footerNavigationData && footerNavigationData?.modules?.length > 0 && pageType !== 'operator'
|
|
36
|
-
?
|
|
35
|
+
? lazy(() => import(`gatsby-core-theme/src/components/organisms/footer-navigation`))
|
|
37
36
|
: null;
|
|
38
37
|
|
|
39
38
|
return (
|
|
40
|
-
<div className={`${
|
|
39
|
+
<div className={`${styles.floatingArea} ${showScroll ? styles.show : ''}`}>
|
|
41
40
|
<ScrollToTop />
|
|
42
41
|
{!['not_recommended', 'inactive', 'blacklisted'].includes(
|
|
43
42
|
pageContext?.page?.relation?.status
|
|
44
43
|
) &&
|
|
45
44
|
OperatorBanner && (
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
<Suspense fallback={<></>}>
|
|
46
|
+
<OperatorBanner
|
|
47
|
+
type={pageType}
|
|
48
|
+
template={template}
|
|
49
|
+
sticky
|
|
50
|
+
logo={pageContext.page.relation.logo_url}
|
|
51
|
+
operator={pageContext.page.relation}
|
|
52
|
+
closedBanner={closedBanner}
|
|
53
|
+
setClosedBanner={setClosedBanner}
|
|
54
|
+
/>
|
|
55
|
+
</Suspense>
|
|
55
56
|
)}
|
|
56
57
|
{CookieConsent && (
|
|
57
58
|
<CookieConsent
|
|
@@ -71,7 +72,11 @@ export default function FloatingArea({
|
|
|
71
72
|
</p>
|
|
72
73
|
</CookieConsent>
|
|
73
74
|
)}
|
|
74
|
-
{FooterNavigation &&
|
|
75
|
+
{FooterNavigation && (
|
|
76
|
+
<Suspense fallback={<></>}>
|
|
77
|
+
<FooterNavigation section={footerNavigationData} />
|
|
78
|
+
</Suspense>
|
|
79
|
+
)}
|
|
75
80
|
</div>
|
|
76
81
|
);
|
|
77
82
|
}
|
|
@@ -97,7 +102,6 @@ FloatingArea.propTypes = {
|
|
|
97
102
|
}),
|
|
98
103
|
}),
|
|
99
104
|
}).isRequired,
|
|
100
|
-
customStyles: PropTypes.string,
|
|
101
105
|
offsetTop: PropTypes.number,
|
|
102
106
|
hideOperatorBanner: PropTypes.bool,
|
|
103
107
|
template: PropTypes.string,
|
|
@@ -19,4 +19,28 @@
|
|
|
19
19
|
margin: 0 auto;
|
|
20
20
|
padding: 2rem;
|
|
21
21
|
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.skeletonoperator {
|
|
25
|
+
min-height: 37.5rem;
|
|
26
|
+
|
|
27
|
+
@include min(tablet) {
|
|
28
|
+
min-height: 48.2rem;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.skeletongame {
|
|
33
|
+
min-height: 28rem;
|
|
34
|
+
|
|
35
|
+
@include min(tablet) {
|
|
36
|
+
min-height: 33rem;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.skeletonpayment {
|
|
41
|
+
min-height: 64.6rem;
|
|
42
|
+
|
|
43
|
+
@include min(tablet) {
|
|
44
|
+
min-height: 57.1rem;
|
|
45
|
+
}
|
|
22
46
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { render, cleanup } from '@testing-library/react';
|
|
3
3
|
import '@testing-library/jest-dom/extend-expect';
|
|
4
4
|
import '~tests/helpers/match-media.mock';
|
|
5
|
-
import Header
|
|
5
|
+
import Header from '.';
|
|
6
6
|
|
|
7
7
|
function getHeaderSection(type = 'page', template = 'author') {
|
|
8
8
|
const header = {
|
|
@@ -31,20 +31,6 @@ function getHeaderSection(type = 'page', template = 'author') {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
describe('header component', () => {
|
|
34
|
-
test('relationContent', () => {
|
|
35
|
-
const list = ['article', 'operator', 'game', 'author'];
|
|
36
|
-
|
|
37
|
-
const all = list.reduce((acc, current) => {
|
|
38
|
-
acc.push(getHeaderSection(current, current));
|
|
39
|
-
return acc;
|
|
40
|
-
}, []);
|
|
41
|
-
|
|
42
|
-
all.forEach((elm) => {
|
|
43
|
-
expect(relationContent(elm.section)).toBeTruthy();
|
|
44
|
-
});
|
|
45
|
-
expect(relationContent('test')).toBeFalsy();
|
|
46
|
-
});
|
|
47
|
-
|
|
48
34
|
test('only page', () => {
|
|
49
35
|
const HeaderProps = getHeaderSection('page', 'default');
|
|
50
36
|
const { container } = render(<Header {...HeaderProps} />);
|