gatsby-core-theme 2.0.19 → 2.2.2
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 +83 -0
- package/gatsby-node.esm.js +2 -22
- package/package.json +1 -1
- package/src/components/atoms/bonus/bonus.test.js +1 -2
- package/src/components/atoms/disclaimer/disclaimer.test.js +24 -0
- package/src/components/atoms/disclaimer/index.js +45 -0
- package/src/components/atoms/menu/items/item/index.js +7 -3
- package/src/components/molecules/counter/counter-item/counter-item.module.scss +10 -15
- package/src/components/molecules/counter/counter-item/index.js +12 -14
- package/src/components/molecules/counter/counter.module.scss +2 -0
- package/src/components/molecules/counter/index.js +16 -14
- package/src/components/organisms/anchor/anchor.module.scss +17 -4
- package/src/components/organisms/anchor/index.js +3 -11
- package/src/components/organisms/cards/cards.module.scss +2 -0
- package/src/components/organisms/head/index.js +4 -0
- package/src/helpers/css-parser.js +7 -5
- package/src/helpers/css-parser.test.js +1 -1
- package/src/helpers/generators.js +3 -3
- package/src/helpers/generators.test.js +1 -1
- package/src/helpers/processor/common.js +1 -1
- package/src/helpers/processor/index.js +27 -1
- package/src/helpers/processor/modules.js +17 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,86 @@
|
|
|
1
|
+
## [2.2.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.2.1...v2.2.2) (2022-01-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* dmca url fix ([778e0a6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/778e0a6ed1fc4828e165203c090d3cf26f3ac1a9))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
* Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([cf5e415](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cf5e4157bc7a75842dbf9f71c34501bd631b111f))
|
|
10
|
+
|
|
11
|
+
## [2.2.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.2.0...v2.2.1) (2022-01-20)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* dmca badge now using env var for id ([bc65104](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/bc651049d3a435ee0cbf4b7f2bd418a300609fc8))
|
|
17
|
+
|
|
18
|
+
# [2.2.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.1.0...v2.2.0) (2022-01-18)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* add track background color ([8886659](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/888665908dc7a97e008d42321e1a61482d1d31d8))
|
|
24
|
+
* add variable thumb-color ([7d0d1da](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7d0d1da9f6244573fa38dca0fbc463ceb0e5840d))
|
|
25
|
+
* dmca ([a320701](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a320701a80b61e1a354fcc295f531d763b683261))
|
|
26
|
+
* fixes ([3886daf](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3886daf5e8771ae69e4379a440ed944b23d39ae6))
|
|
27
|
+
* menu item, cards row gap ([6fca1e4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6fca1e4f9117bd0d84c143ba57eb0531b467327b))
|
|
28
|
+
* menu item, cards row gap ([cd319ca](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cd319ca0f4efa1845e5cf2df1e22644dd366e312))
|
|
29
|
+
* placeholder ([8c9b5bd](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8c9b5bdaef7173406689e3e210e586b237d46ba3))
|
|
30
|
+
* relocate placeholders to processor ([96c17f6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/96c17f636abc652013d0bf396b3a496a167748ea))
|
|
31
|
+
* removed slider from anchor module ([185975f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/185975f75a3f6a592a4477d772ccf148e17e07ce))
|
|
32
|
+
* small fixes ([cc29dfa](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cc29dfa365105bbaae1b14c0b9641d2d936c1ffe))
|
|
33
|
+
* use generateplaceholder for sitemap titles ([9e3ef4e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9e3ef4ee5f8f0c5dff129f2da8a50f3997215feb))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Code Refactoring
|
|
37
|
+
|
|
38
|
+
* move replacePlaceholder to gatsby node esm ([9eb9d84](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9eb9d842f2ef1496550348a502d1323ce1552475))
|
|
39
|
+
* update counter li key prop ([8796b36](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8796b361618e44347e1250943e2d31a6b8977b09))
|
|
40
|
+
* update generators tests ([39dd1f5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/39dd1f5e24f7e79abbaf98793be83ede80ca7a14))
|
|
41
|
+
* update placeholder generation in gatsby-node.esm, processSitemapPages and generatePlaceholderString ([52ae3fe](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/52ae3fe551d4520296be05302df58a1880f46970))
|
|
42
|
+
* update processSitemapPages for tests and remove generatePlaceholderString import ([3b73cb8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3b73cb84a2d4d00ceb625aa0f21a4416990dfc34))
|
|
43
|
+
* update siteInfo check for node process ([6940762](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/69407626dda1f4541b86589c2f738929363ddb09))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
* Merge branch 'tm-2625-dmca' into 'master' ([d75e192](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d75e1927e5c8eac06426c43b5e18396202359b72))
|
|
47
|
+
* Merge branch 'tm-2654-minor-fixes' into 'master' ([d207bd6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d207bd6a376d390714c157f82f98ccdca3334844))
|
|
48
|
+
* Merge branch 'tm-2656-placeholder' into 'master' ([92d1b1b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/92d1b1b36f733f9b880750b36aa710bd5bba536a))
|
|
49
|
+
* Merge branch 'tm-2557-cards-v2-changes' into 'master' ([bd5c28f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/bd5c28f764cb38a949d0638d6bf4782a7ad9de14))
|
|
50
|
+
* Merge branch 'tm-2655-anchor-module' into 'master' ([4748e7a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4748e7a8458003eea7c8dd0c163fb338dcd2f173))
|
|
51
|
+
* Merge branch 'tm-2656-fix-placeholders' into 'master' ([b8a06f3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b8a06f3cc24fc39df0ca949c404c41ed69a13ad8))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Features
|
|
55
|
+
|
|
56
|
+
* cards v2 filters cvhanges ([b0f3a96](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b0f3a96cc784fcf432cee9c14b63574df362e05f))
|
|
57
|
+
|
|
58
|
+
# [2.1.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.19...v2.1.0) (2022-01-13)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Bug Fixes
|
|
62
|
+
|
|
63
|
+
* added dmca as component ([2aae7bc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2aae7bc3cf0d8ba1210154ad0f7aecd24221c92d))
|
|
64
|
+
* added lazyload and image added as prop ([71b7ad7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/71b7ad70f0499a09eeada813fce007c273c99422))
|
|
65
|
+
* test ([d103191](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d103191b379926afd7ae9effcd29f0cbe61d9c28))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### Code Refactoring
|
|
69
|
+
|
|
70
|
+
* update counter and counterItem for w3 validator ([9ebbcdc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9ebbcdcbe14f0a5adf8ca6acedfbe1c7c7b19ec3))
|
|
71
|
+
* update css parser for w3 validator ([db7dd7d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/db7dd7d76f3d0404a19471bdf45e883bff635512))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
* Merge branch 'tm-2654-open-graph' into 'master' ([0e2a375](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0e2a37579483adde033aa19e58b677fa80e75f3a))
|
|
75
|
+
* Merge branch 'tm-2567-update-theme-for-w3-validator' into 'master' ([cb0ab99](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cb0ab990a56d26a7591bb089d2ed38f001b0cc74))
|
|
76
|
+
* Merge branch 'tm-2625-dmca-implementation' into 'master' ([8cb7230](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8cb7230734fb97c2222ebb8207c646206ab9d92c))
|
|
77
|
+
* Merge branch 'tm-2567-update-theme-for-w3-validator' into tm-2567-update-theme-for-w3-validator ([2a0701e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2a0701e35a71d0d00e86d303d82843b0897531fb))
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
### Features
|
|
81
|
+
|
|
82
|
+
* added new og properties ([2aba269](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2aba2697f9f80b1326e0118a8bf80f50f52e721f))
|
|
83
|
+
|
|
1
84
|
## [2.0.19](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.18...v2.0.19) (2022-01-11)
|
|
2
85
|
|
|
3
86
|
|
package/gatsby-node.esm.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { cloneDeep, chunk, pick } from 'lodash';
|
|
6
6
|
import chalk from 'chalk';
|
|
7
7
|
import { getData, getLocalData } from './src/helpers/api';
|
|
8
|
-
import {
|
|
8
|
+
import { generateTrackerLink } from './src/helpers/generators';
|
|
9
9
|
import processor, { processSitemapPages } from './src/helpers/processor';
|
|
10
10
|
import { pickAuthorsPageKeys } from './src/constants/pick-keys';
|
|
11
11
|
|
|
@@ -150,13 +150,13 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
|
|
|
150
150
|
// add data to modules
|
|
151
151
|
const processed = processor.run(response, themeOptions, fs);
|
|
152
152
|
pages = processed.pages;
|
|
153
|
-
htmlSitemapPages = processSitemapPages(pages, processed.site_markets);
|
|
154
153
|
siteInfo = processed.general;
|
|
155
154
|
operators = processed.relations.operator;
|
|
156
155
|
templates = processed.templates;
|
|
157
156
|
// eslint-disable-next-line prefer-destructuring
|
|
158
157
|
languageKey = Object.keys(processed.relations.translations)[0];
|
|
159
158
|
translations = processed.relations.translations[languageKey];
|
|
159
|
+
htmlSitemapPages = processSitemapPages(pages, processed.site_markets);
|
|
160
160
|
|
|
161
161
|
if (themeOptions.siteType === 'sport') {
|
|
162
162
|
sports = Object.keys(response.relations['sports_data'].sports).map(
|
|
@@ -204,26 +204,6 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
|
|
|
204
204
|
pick(authors[key], pickAuthorsPageKeys)
|
|
205
205
|
);
|
|
206
206
|
|
|
207
|
-
// replacing string placehoders with year, month, date, etc.
|
|
208
|
-
page.title =
|
|
209
|
-
page.title &&
|
|
210
|
-
generatePlaceholderString(page.title, translations, {
|
|
211
|
-
siteName: response.general.site_name,
|
|
212
|
-
siteTitle: page.title,
|
|
213
|
-
});
|
|
214
|
-
page.meta_title =
|
|
215
|
-
page.meta_title &&
|
|
216
|
-
generatePlaceholderString(page.meta_title, translations, {
|
|
217
|
-
siteName: response.general.site_name,
|
|
218
|
-
siteTitle: page.title,
|
|
219
|
-
});
|
|
220
|
-
page.meta_description =
|
|
221
|
-
page.meta_description &&
|
|
222
|
-
generatePlaceholderString(page.meta_description, translations, {
|
|
223
|
-
siteName: response.general.site_name,
|
|
224
|
-
siteTitle: page.title,
|
|
225
|
-
});
|
|
226
|
-
|
|
227
207
|
if (hasArchiveModule(page)) {
|
|
228
208
|
createArchivePage(page, marketSections, prefilledModules, createPage);
|
|
229
209
|
return;
|
package/package.json
CHANGED
|
@@ -8,10 +8,9 @@ import Bonus from '.';
|
|
|
8
8
|
describe('Bonus Component', () => {
|
|
9
9
|
test('render with props', () => {
|
|
10
10
|
const item = getToplistItem();
|
|
11
|
-
const {
|
|
11
|
+
const { getByText } = render(<Bonus item={item} tracker="main" />);
|
|
12
12
|
expect(getByText('€100 welcome bonus')).toBeTruthy();
|
|
13
13
|
expect(getByText('€100 welcome bonus').getAttribute('class')).toEqual('title');
|
|
14
|
-
expect(container.querySelector('div.bonus')).toBeTruthy();
|
|
15
14
|
});
|
|
16
15
|
test('without oneLiner', () => {
|
|
17
16
|
const { container } = render(
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, cleanup } from '@testing-library/react';
|
|
3
|
+
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
|
|
6
|
+
import Disclaimer from '.';
|
|
7
|
+
|
|
8
|
+
const dmcaImg = (
|
|
9
|
+
<img
|
|
10
|
+
src="https://images.dmca.com/Badges/_dmca_premi_badge_1.png?ID=9e466e76-827d-4247-ac51-4eb75b227301"
|
|
11
|
+
alt="DMCA.com Protection Status"
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
describe('Disclaimer Component', () => {
|
|
16
|
+
test('render disclaimer badge', () => {
|
|
17
|
+
const { container } = render(<Disclaimer image={dmcaImg} />);
|
|
18
|
+
expect(container.querySelectorAll('a')).toHaveLength(1);
|
|
19
|
+
expect(container.querySelectorAll('img')).toHaveLength(1);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
afterEach(() => {
|
|
23
|
+
cleanup();
|
|
24
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* eslint-disable no-return-assign */
|
|
2
|
+
/* eslint-disable no-plusplus */
|
|
3
|
+
/* eslint-disable no-var */
|
|
4
|
+
import React, { useRef } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
|
|
7
|
+
const Disclaimer = ({ image }) => {
|
|
8
|
+
const anchorElement = useRef(null);
|
|
9
|
+
|
|
10
|
+
function dmca() {
|
|
11
|
+
document.addEventListener(
|
|
12
|
+
'click',
|
|
13
|
+
() => {
|
|
14
|
+
const element = anchorElement.current;
|
|
15
|
+
if (element.getAttribute('href').indexOf('refurl') < 0) {
|
|
16
|
+
element.href = `${`${
|
|
17
|
+
element.href + (element.href.indexOf('?') === -1 ? '?' : '&')
|
|
18
|
+
}refurl`}=${document.location.href.replace(/\/$/, '')}`;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
false
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<>
|
|
27
|
+
<a
|
|
28
|
+
ref={anchorElement}
|
|
29
|
+
onClick={dmca}
|
|
30
|
+
href={`//www.dmca.com/Protection/Status.aspx?ID=${process.env.DMCA_PROTECTION_ID}`}
|
|
31
|
+
title="DMCA.com Protection Status"
|
|
32
|
+
target="_blank"
|
|
33
|
+
rel="noreferrer"
|
|
34
|
+
>
|
|
35
|
+
{image}
|
|
36
|
+
</a>
|
|
37
|
+
</>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default Disclaimer;
|
|
42
|
+
|
|
43
|
+
Disclaimer.propTypes = {
|
|
44
|
+
image: PropTypes.node,
|
|
45
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-nested-ternary */
|
|
1
2
|
import React, { useState, useEffect, useContext } from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import Link from '~hooks/link';
|
|
@@ -63,7 +64,7 @@ export default function Item({
|
|
|
63
64
|
{item.value?.includes('http') || item.value?.includes('www') ? (
|
|
64
65
|
<a
|
|
65
66
|
aria-label={`${item?.title} link`}
|
|
66
|
-
href={item.value}
|
|
67
|
+
href={item.value ? item.value : '#'}
|
|
67
68
|
title={item.title}
|
|
68
69
|
rel={`noreferrer ${item.nofollow && 'nofollow'}`}
|
|
69
70
|
target="_blank"
|
|
@@ -78,7 +79,7 @@ export default function Item({
|
|
|
78
79
|
<ItemImage />
|
|
79
80
|
{item.title}
|
|
80
81
|
</a>
|
|
81
|
-
) : (
|
|
82
|
+
) : item.value !== null ? (
|
|
82
83
|
<Link
|
|
83
84
|
className={`${gtmClass} ${styles.item} ${opened && styles.openedLink} ${active} ${
|
|
84
85
|
!options.mobile.subMenuDropDownButton && isMobile && hasChildren
|
|
@@ -87,7 +88,8 @@ export default function Item({
|
|
|
87
88
|
} ${hasChildren ? styles.hasChildren : ''} ${
|
|
88
89
|
!options.mobile.subMenuDropDownButton ? styles.noDropDownButton : ''
|
|
89
90
|
}`}
|
|
90
|
-
|
|
91
|
+
disabled={item.value === null}
|
|
92
|
+
to={item.value}
|
|
91
93
|
title={item.title}
|
|
92
94
|
rel={item.nofollow && 'nofollow'}
|
|
93
95
|
aria-label={`${item?.title} link`}
|
|
@@ -96,6 +98,8 @@ export default function Item({
|
|
|
96
98
|
<ItemImage />
|
|
97
99
|
{item.title}
|
|
98
100
|
</Link>
|
|
101
|
+
) : (
|
|
102
|
+
<div className={styles.item}>{item.title}</div>
|
|
99
103
|
)}
|
|
100
104
|
{options.mobile.subMenuDropDownButton && isMobile && hasChildren && (
|
|
101
105
|
<button
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
color: black;
|
|
7
|
-
font: {
|
|
8
|
-
size: var(--h2-size);
|
|
9
|
-
weight: bold;
|
|
10
|
-
}
|
|
1
|
+
.title {
|
|
2
|
+
color: black;
|
|
3
|
+
font: {
|
|
4
|
+
size: var(--h2-size);
|
|
5
|
+
weight: bold;
|
|
11
6
|
}
|
|
7
|
+
}
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
9
|
+
.value {
|
|
10
|
+
font: {
|
|
11
|
+
weight: bold;
|
|
12
|
+
size: 10rem;
|
|
18
13
|
}
|
|
19
14
|
}
|
|
@@ -5,20 +5,18 @@ import LazyLoad from 'react-lazyload';
|
|
|
5
5
|
import CountNumber from './count-number';
|
|
6
6
|
import styles from './counter-item.module.scss';
|
|
7
7
|
|
|
8
|
-
const CounterItem = ({ data, icon }) =>
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
);
|
|
21
|
-
};
|
|
8
|
+
const CounterItem = ({ data, icon }) => (
|
|
9
|
+
<>
|
|
10
|
+
<div className={styles.title}>{data.title}</div>
|
|
11
|
+
<div className={styles.value}>
|
|
12
|
+
{icon && icon}
|
|
13
|
+
{/* run count up if the item is visible and has not counted up yet */}
|
|
14
|
+
<LazyLoad>
|
|
15
|
+
<CountNumber end={parseInt(data.value)} />
|
|
16
|
+
</LazyLoad>
|
|
17
|
+
</div>
|
|
18
|
+
</>
|
|
19
|
+
);
|
|
22
20
|
|
|
23
21
|
CounterItem.propTypes = {
|
|
24
22
|
data: PropTypes.shape({
|
|
@@ -7,20 +7,22 @@ import CounterItem from './counter-item';
|
|
|
7
7
|
import styles from './counter.module.scss';
|
|
8
8
|
import keygen from '~helpers/keygen';
|
|
9
9
|
|
|
10
|
-
const Counter = ({ module }) =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
{module.content
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
const Counter = ({ module }) => (
|
|
11
|
+
<>
|
|
12
|
+
{module.content && (
|
|
13
|
+
<p className={styles.counterContent} dangerouslySetInnerHTML={{ __html: module.content }} />
|
|
14
|
+
)}
|
|
15
|
+
<ul className={styles.counter}>
|
|
16
|
+
{module.items.map((item) => {
|
|
17
|
+
return (
|
|
18
|
+
<li key={keygen()}>
|
|
19
|
+
<CounterItem data={item} />;
|
|
20
|
+
</li>
|
|
21
|
+
);
|
|
22
|
+
})}
|
|
23
|
+
</ul>
|
|
24
|
+
</>
|
|
25
|
+
);
|
|
24
26
|
|
|
25
27
|
Counter.propTypes = {
|
|
26
28
|
module: PropTypes.shape({
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
.
|
|
1
|
+
.anchor {
|
|
2
|
+
@include flex-direction(row);
|
|
3
|
+
&::-webkit-scrollbar {
|
|
4
|
+
height: 0.5rem;
|
|
5
|
+
}
|
|
6
|
+
&::-webkit-scrollbar-track {
|
|
7
|
+
background: var(--anchor-track-color);
|
|
8
|
+
}
|
|
9
|
+
&::-webkit-scrollbar-thumb {
|
|
10
|
+
background: var(--anchor-thumb-color);
|
|
11
|
+
}
|
|
12
|
+
overflow-x: scroll;
|
|
2
13
|
.link {
|
|
3
14
|
word-break: inherit;
|
|
4
15
|
white-space: nowrap;
|
|
5
|
-
|
|
16
|
+
margin-bottom: 0.5rem;
|
|
6
17
|
background-color: var(--color-7);
|
|
7
18
|
padding: 1rem 2.5rem;
|
|
8
19
|
border-radius: 0.6rem;
|
|
9
20
|
color: #000;
|
|
10
21
|
font-weight: 400;
|
|
22
|
+
margin-right: 1.6rem;
|
|
23
|
+
margin-bottom: 0.5rem;
|
|
11
24
|
|
|
12
25
|
&:hover {
|
|
13
26
|
background-color: var(--secondary-color);
|
|
@@ -15,10 +28,10 @@
|
|
|
15
28
|
}
|
|
16
29
|
}
|
|
17
30
|
}
|
|
18
|
-
.storyDivs{
|
|
31
|
+
.storyDivs {
|
|
19
32
|
width: 100%;
|
|
20
33
|
display: block;
|
|
21
34
|
margin: 3rem 0;
|
|
22
35
|
background-color: #eee;
|
|
23
36
|
padding: 2rem;
|
|
24
|
-
}
|
|
37
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
import Slider from '~molecules/slider';
|
|
5
4
|
import keygen from '~helpers/keygen';
|
|
6
5
|
import { anchorLink } from '~helpers/strings';
|
|
7
6
|
import styles from './anchor.module.scss';
|
|
8
7
|
|
|
9
|
-
function Anchor({ module: { items }, headerOffset = 80
|
|
8
|
+
function Anchor({ module: { items }, headerOffset = 80 }) {
|
|
10
9
|
const handleClick = (event) => {
|
|
11
10
|
event.preventDefault();
|
|
12
11
|
const scrollToElementId = event.currentTarget.getAttribute('href').replace('#', '');
|
|
@@ -23,13 +22,7 @@ function Anchor({ module: { items }, headerOffset = 80, sliderGap = 0 }) {
|
|
|
23
22
|
};
|
|
24
23
|
|
|
25
24
|
return (
|
|
26
|
-
<
|
|
27
|
-
useArrows={false}
|
|
28
|
-
usePagination={false}
|
|
29
|
-
settings={{ numberOfSlides: 0, sliderGap }}
|
|
30
|
-
className={styles.sliderWrapper}
|
|
31
|
-
gtmClass="anchor-carousel-gtm"
|
|
32
|
-
>
|
|
25
|
+
<div className={styles.anchor} gtmClass="anchor-carousel-gtm">
|
|
33
26
|
{items.map((anchor) => (
|
|
34
27
|
<a
|
|
35
28
|
className={`${styles.link} anchor-carousel-gtm anchor-menu-gtm`}
|
|
@@ -40,7 +33,7 @@ function Anchor({ module: { items }, headerOffset = 80, sliderGap = 0 }) {
|
|
|
40
33
|
{anchor?.label}
|
|
41
34
|
</a>
|
|
42
35
|
))}
|
|
43
|
-
</
|
|
36
|
+
</div>
|
|
44
37
|
);
|
|
45
38
|
}
|
|
46
39
|
|
|
@@ -53,7 +46,6 @@ Anchor.propTypes = {
|
|
|
53
46
|
),
|
|
54
47
|
}).isRequired,
|
|
55
48
|
headerOffset: PropTypes.number.isRequired,
|
|
56
|
-
sliderGap: PropTypes.number,
|
|
57
49
|
styles: PropTypes.shape({}),
|
|
58
50
|
};
|
|
59
51
|
|
|
@@ -66,6 +66,10 @@ const Head = ({ page = {}, siteInfo }) => {
|
|
|
66
66
|
<meta name="og:type" content={page.path === '/' ? 'website' : 'article'} />
|
|
67
67
|
<meta name="og:image" content={pageImage} />
|
|
68
68
|
<meta name="og:url" content={getUrl(page.path)} />
|
|
69
|
+
<meta
|
|
70
|
+
property="og:locale"
|
|
71
|
+
content={getLanguage(page.language) === 'en' ? 'en_GB' : getLanguage(page.language)}
|
|
72
|
+
/>
|
|
69
73
|
|
|
70
74
|
{schemaGenerator(page, pageImage).map(
|
|
71
75
|
(schema) =>
|
|
@@ -6,11 +6,13 @@ export function parseCss(css) {
|
|
|
6
6
|
let token;
|
|
7
7
|
|
|
8
8
|
while ((token = tokenizer.exec(cssFormat))) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
if (token[2] && token[2] !== 'null') {
|
|
10
|
+
obj[
|
|
11
|
+
token[1].replace(/-([a-z])/g, function (g) {
|
|
12
|
+
return g[1].toUpperCase();
|
|
13
|
+
})
|
|
14
|
+
] = token[2];
|
|
15
|
+
}
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
return obj;
|
|
@@ -5,7 +5,7 @@ describe('parseCss Helper', () => {
|
|
|
5
5
|
expect(typeof parseCss('margin-left: 20px;')).toEqual('object');
|
|
6
6
|
});
|
|
7
7
|
test('output', () => {
|
|
8
|
-
expect(parseCss('margin-left: 20px; margin-bottom:40px')).toEqual({
|
|
8
|
+
expect(parseCss('margin-left: 20px; margin-bottom:40px; height: null')).toEqual({
|
|
9
9
|
marginBottom: '40px',
|
|
10
10
|
marginLeft: '20px',
|
|
11
11
|
});
|
|
@@ -21,7 +21,7 @@ export function generateTrackerLink(operator, trackerType) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export function generatePlaceholderString(string, translations,
|
|
24
|
+
export function generatePlaceholderString(string = '', translations, data) {
|
|
25
25
|
const date = new Date();
|
|
26
26
|
const day = date.getDate();
|
|
27
27
|
const month = months[date.getMonth()];
|
|
@@ -38,8 +38,8 @@ export function generatePlaceholderString(string, translations, props) {
|
|
|
38
38
|
'[currentdate]': `${(translations && translations[month]) || month} ${day}, ${year}`,
|
|
39
39
|
'[currentmonth]': (translations && translations[month]) || month,
|
|
40
40
|
'[currentyear]': year,
|
|
41
|
-
'[sitename]': (
|
|
42
|
-
'[title]': (
|
|
41
|
+
'[sitename]': (data && data.siteName) || '',
|
|
42
|
+
'[title]': (data && data.pageTitle) || '',
|
|
43
43
|
}[match])
|
|
44
44
|
);
|
|
45
45
|
}
|
|
@@ -4,7 +4,7 @@ import settings from '../../constants/settings';
|
|
|
4
4
|
// eslint-disable-next-line import/no-cycle
|
|
5
5
|
import { processExtraFields } from '.';
|
|
6
6
|
|
|
7
|
-
export function groupBy(list, keyName = 'author_id', single = false) {
|
|
7
|
+
export function groupBy(list = {}, keyName = 'author_id', single = false) {
|
|
8
8
|
const newObj = Object.values(list).reduce((acc, currentVal) => {
|
|
9
9
|
if (!acc[currentVal[keyName]]) {
|
|
10
10
|
acc[currentVal[keyName]] = [];
|
|
@@ -8,7 +8,7 @@ import chalk from 'chalk';
|
|
|
8
8
|
import ModuleValue from '../../constants/module-value';
|
|
9
9
|
import SearchTypesEnable from '../../constants/search-types-enable';
|
|
10
10
|
import { pickHTMLSitemapPageKeys } from '../../constants/pick-keys';
|
|
11
|
-
|
|
11
|
+
import { generatePlaceholderString } from '../generators';
|
|
12
12
|
// eslint-disable-next-line import/no-cycle
|
|
13
13
|
import { processModule } from './modules';
|
|
14
14
|
// eslint-disable-next-line import/no-cycle
|
|
@@ -131,6 +131,31 @@ export function processExtraFields(extraFields) {
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
function updatePlaceholders(page, data) {
|
|
135
|
+
const languageKey = Object.keys(data.relations.translations)[0];
|
|
136
|
+
const translations = data.relations.translations[languageKey];
|
|
137
|
+
|
|
138
|
+
// replacing string placehoders with year, month, date, etc.
|
|
139
|
+
page.title =
|
|
140
|
+
page.title &&
|
|
141
|
+
generatePlaceholderString(page.title, translations, {
|
|
142
|
+
siteName: data.general.site_name,
|
|
143
|
+
siteTitle: page.title,
|
|
144
|
+
});
|
|
145
|
+
page.meta_title =
|
|
146
|
+
page.meta_title &&
|
|
147
|
+
generatePlaceholderString(page.meta_title, translations, {
|
|
148
|
+
siteName: data.general.site_name,
|
|
149
|
+
siteTitle: page.title,
|
|
150
|
+
});
|
|
151
|
+
page.meta_description =
|
|
152
|
+
page.meta_description &&
|
|
153
|
+
generatePlaceholderString(page.meta_description, translations, {
|
|
154
|
+
siteName: data.general.site_name,
|
|
155
|
+
siteTitle: page.title,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
134
159
|
export default {
|
|
135
160
|
run(data, themeOptions, fs) {
|
|
136
161
|
const start = new Date();
|
|
@@ -163,6 +188,7 @@ export default {
|
|
|
163
188
|
transformedPages[market][pageType].forEach((page, index) => {
|
|
164
189
|
// process page extra fields
|
|
165
190
|
processExtraFields(page.extra_fields);
|
|
191
|
+
updatePlaceholders(page, data);
|
|
166
192
|
|
|
167
193
|
// set page relation
|
|
168
194
|
if (
|
|
@@ -114,19 +114,25 @@ export function processCardsV2(module, pagesCloned, pagesMappedById) {
|
|
|
114
114
|
pagesMappedById[page_id] && module.items.push(pagesMappedById[page_id]);
|
|
115
115
|
});
|
|
116
116
|
} else if (cardSelector === 'use_filters') {
|
|
117
|
-
|
|
118
|
-
const pagesGroupedByType = pagesCloned[pageType];
|
|
117
|
+
let pagesList = [];
|
|
119
118
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
if (pageType) {
|
|
120
|
+
// Get all pages by the selected page type
|
|
121
|
+
const pagesGroupedByType = pagesCloned[pageType];
|
|
122
|
+
|
|
123
|
+
// Grouping pages by template ID
|
|
124
|
+
if (!pagesGroupedByTemplateId[pageType]) {
|
|
125
|
+
pagesGroupedByTemplateId[pageType] = groupBy(pagesGroupedByType, 'template_id');
|
|
126
|
+
}
|
|
124
127
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
// Populate pagesList if page type and template exists
|
|
129
|
+
pagesList =
|
|
130
|
+
!pagesGroupedByTemplateId[pageType] || !pagesGroupedByTemplateId[pageType][pageTemplateId]
|
|
131
|
+
? []
|
|
132
|
+
: pagesGroupedByTemplateId[pageType][pageTemplateId];
|
|
133
|
+
} else {
|
|
134
|
+
pagesList = pagesMappedById.map((page) => page);
|
|
135
|
+
}
|
|
130
136
|
|
|
131
137
|
// Check if there are pages before starting filtering
|
|
132
138
|
if (pagesList.length > 0) {
|