gatsby-core-theme 2.0.18 → 2.2.1

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/gatsby-node.esm.js +2 -22
  3. package/package.json +1 -1
  4. package/src/components/atoms/bonus/bonus.module.scss +11 -14
  5. package/src/components/atoms/bonus/bonus.test.js +1 -2
  6. package/src/components/atoms/bonus/index.js +4 -6
  7. package/src/components/atoms/disclaimer/disclaimer.test.js +24 -0
  8. package/src/components/atoms/disclaimer/index.js +45 -0
  9. package/src/components/atoms/menu/items/item/index.js +7 -3
  10. package/src/components/atoms/operator-cta/index.js +2 -1
  11. package/src/components/atoms/selling-points/index.js +2 -3
  12. package/src/components/atoms/selling-points/selling-points.module.scss +1 -2
  13. package/src/components/molecules/counter/counter-item/counter-item.module.scss +10 -15
  14. package/src/components/molecules/counter/counter-item/index.js +12 -14
  15. package/src/components/molecules/counter/counter.module.scss +2 -0
  16. package/src/components/molecules/counter/index.js +16 -14
  17. package/src/components/molecules/toplist/default-row/index.js +8 -1
  18. package/src/components/organisms/anchor/anchor.module.scss +17 -4
  19. package/src/components/organisms/anchor/index.js +3 -11
  20. package/src/components/organisms/cards/cards.module.scss +2 -0
  21. package/src/components/organisms/head/index.js +4 -0
  22. package/src/helpers/css-parser.js +7 -5
  23. package/src/helpers/css-parser.test.js +1 -1
  24. package/src/helpers/generators.js +3 -3
  25. package/src/helpers/generators.test.js +1 -1
  26. package/src/helpers/processor/common.js +1 -1
  27. package/src/helpers/processor/index.js +27 -1
  28. package/src/helpers/processor/modules.js +17 -11
package/CHANGELOG.md CHANGED
@@ -1,3 +1,88 @@
1
+ ## [2.2.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.2.0...v2.2.1) (2022-01-20)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * dmca badge now using env var for id ([bc65104](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/bc651049d3a435ee0cbf4b7f2bd418a300609fc8))
7
+
8
+ # [2.2.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.1.0...v2.2.0) (2022-01-18)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add track background color ([8886659](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/888665908dc7a97e008d42321e1a61482d1d31d8))
14
+ * add variable thumb-color ([7d0d1da](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7d0d1da9f6244573fa38dca0fbc463ceb0e5840d))
15
+ * dmca ([a320701](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a320701a80b61e1a354fcc295f531d763b683261))
16
+ * fixes ([3886daf](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3886daf5e8771ae69e4379a440ed944b23d39ae6))
17
+ * menu item, cards row gap ([6fca1e4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6fca1e4f9117bd0d84c143ba57eb0531b467327b))
18
+ * menu item, cards row gap ([cd319ca](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cd319ca0f4efa1845e5cf2df1e22644dd366e312))
19
+ * placeholder ([8c9b5bd](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8c9b5bdaef7173406689e3e210e586b237d46ba3))
20
+ * relocate placeholders to processor ([96c17f6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/96c17f636abc652013d0bf396b3a496a167748ea))
21
+ * removed slider from anchor module ([185975f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/185975f75a3f6a592a4477d772ccf148e17e07ce))
22
+ * small fixes ([cc29dfa](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cc29dfa365105bbaae1b14c0b9641d2d936c1ffe))
23
+ * use generateplaceholder for sitemap titles ([9e3ef4e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9e3ef4ee5f8f0c5dff129f2da8a50f3997215feb))
24
+
25
+
26
+ ### Code Refactoring
27
+
28
+ * move replacePlaceholder to gatsby node esm ([9eb9d84](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9eb9d842f2ef1496550348a502d1323ce1552475))
29
+ * update counter li key prop ([8796b36](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8796b361618e44347e1250943e2d31a6b8977b09))
30
+ * update generators tests ([39dd1f5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/39dd1f5e24f7e79abbaf98793be83ede80ca7a14))
31
+ * update placeholder generation in gatsby-node.esm, processSitemapPages and generatePlaceholderString ([52ae3fe](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/52ae3fe551d4520296be05302df58a1880f46970))
32
+ * update processSitemapPages for tests and remove generatePlaceholderString import ([3b73cb8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3b73cb84a2d4d00ceb625aa0f21a4416990dfc34))
33
+ * update siteInfo check for node process ([6940762](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/69407626dda1f4541b86589c2f738929363ddb09))
34
+
35
+
36
+ * Merge branch 'tm-2625-dmca' into 'master' ([d75e192](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d75e1927e5c8eac06426c43b5e18396202359b72))
37
+ * Merge branch 'tm-2654-minor-fixes' into 'master' ([d207bd6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d207bd6a376d390714c157f82f98ccdca3334844))
38
+ * Merge branch 'tm-2656-placeholder' into 'master' ([92d1b1b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/92d1b1b36f733f9b880750b36aa710bd5bba536a))
39
+ * Merge branch 'tm-2557-cards-v2-changes' into 'master' ([bd5c28f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/bd5c28f764cb38a949d0638d6bf4782a7ad9de14))
40
+ * Merge branch 'tm-2655-anchor-module' into 'master' ([4748e7a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4748e7a8458003eea7c8dd0c163fb338dcd2f173))
41
+ * Merge branch 'tm-2656-fix-placeholders' into 'master' ([b8a06f3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b8a06f3cc24fc39df0ca949c404c41ed69a13ad8))
42
+
43
+
44
+ ### Features
45
+
46
+ * cards v2 filters cvhanges ([b0f3a96](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b0f3a96cc784fcf432cee9c14b63574df362e05f))
47
+
48
+ # [2.1.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.19...v2.1.0) (2022-01-13)
49
+
50
+
51
+ ### Bug Fixes
52
+
53
+ * added dmca as component ([2aae7bc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2aae7bc3cf0d8ba1210154ad0f7aecd24221c92d))
54
+ * added lazyload and image added as prop ([71b7ad7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/71b7ad70f0499a09eeada813fce007c273c99422))
55
+ * test ([d103191](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d103191b379926afd7ae9effcd29f0cbe61d9c28))
56
+
57
+
58
+ ### Code Refactoring
59
+
60
+ * update counter and counterItem for w3 validator ([9ebbcdc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9ebbcdcbe14f0a5adf8ca6acedfbe1c7c7b19ec3))
61
+ * update css parser for w3 validator ([db7dd7d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/db7dd7d76f3d0404a19471bdf45e883bff635512))
62
+
63
+
64
+ * Merge branch 'tm-2654-open-graph' into 'master' ([0e2a375](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0e2a37579483adde033aa19e58b677fa80e75f3a))
65
+ * Merge branch 'tm-2567-update-theme-for-w3-validator' into 'master' ([cb0ab99](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cb0ab990a56d26a7591bb089d2ed38f001b0cc74))
66
+ * Merge branch 'tm-2625-dmca-implementation' into 'master' ([8cb7230](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8cb7230734fb97c2222ebb8207c646206ab9d92c))
67
+ * 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))
68
+
69
+
70
+ ### Features
71
+
72
+ * added new og properties ([2aba269](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2aba2697f9f80b1326e0118a8bf80f50f52e721f))
73
+
74
+ ## [2.0.19](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.18...v2.0.19) (2022-01-11)
75
+
76
+
77
+ ### Bug Fixes
78
+
79
+ * bonus and selleing points extra divs ([892d6a4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/892d6a4542efeb16717136472b0422ca5e089ca8))
80
+ * make key dynamic cta ([a7b883c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a7b883cfa2010d5e95d54137e1cb7f86a92115ac))
81
+
82
+
83
+ * Merge branch 'tm-2473-lottery-fixes' into 'master' ([fbc331c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/fbc331c1d3f8ff3276b56e518e6de3e359393fc2))
84
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([86b2be9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/86b2be99241420c6fb77fb3bea3e22f69a1ddb98))
85
+
1
86
  ## [2.0.18](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.17...v2.0.18) (2022-01-10)
2
87
 
3
88
 
@@ -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 { generatePlaceholderString, generateTrackerLink } from './src/helpers/generators';
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "2.0.18",
3
+ "version": "2.2.1",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -1,15 +1,12 @@
1
- .bonus {
2
- @include flex-direction(column);
3
- div:first-child {
4
- font-size: 2rem;
5
- font-weight: 700;
6
- color: var(--primary-color);
7
- padding-right: 1rem;
8
- }
9
- div:nth-child(2) {
10
- font-size: 1.6rem;
11
- color: var(--color-22);
12
- font-weight: 700;
13
- padding: 0.5rem 0;
14
- }
1
+ .title {
2
+ font-size: 2rem;
3
+ font-weight: 700;
4
+ color: var(--primary-color);
5
+ padding-right: 1rem;
6
+ }
7
+ .desc {
8
+ font-size: 1.6rem;
9
+ color: var(--color-22);
10
+ font-weight: 700;
11
+ padding: 0.5rem 0;
15
12
  }
@@ -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 { container, getByText } = render(<Bonus item={item} tracker="main" />);
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(
@@ -14,12 +14,10 @@ const Bonus = ({ item, tracker = 'main' }) => {
14
14
  const onelinerSplitted = oneLiner.one_liner.split('+');
15
15
 
16
16
  return (
17
- <div className={styles.bonus}>
18
- <div className={styles.title}>{onelinerSplitted[0]}</div>
19
- {onelinerSplitted.length === 2 && (
20
- <div className={styles.desc}>{`+${onelinerSplitted[1]}`}</div>
21
- )}
22
- </div>
17
+ <>
18
+ <p className={styles.title}>{onelinerSplitted[0]}</p>
19
+ {onelinerSplitted.length === 2 && <p className={styles.desc}>{`+${onelinerSplitted[1]}`}</p>}
20
+ </>
23
21
  );
24
22
  };
25
23
 
@@ -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}`;
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
- to={item.value ? item.value : '#'}
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
@@ -12,6 +12,7 @@ export default function OperatorCta({
12
12
  placeholderText = 'Coming Soon',
13
13
  closedCasinoText = 'This Casino has closed',
14
14
  playText = 'Visit',
15
+ translationKey = 'play_now',
15
16
  tracker = 'main',
16
17
  gtmClass = '',
17
18
  }) {
@@ -46,7 +47,7 @@ export default function OperatorCta({
46
47
 
47
48
  const trackerType = tracker.toLowerCase().replace(' ', '_');
48
49
  const prettyLink = prettyTracker(operator, trackerType);
49
- const translateBtn = translate(translations, 'play_now', playText);
50
+ const translateBtn = translate(translations, translationKey, playText);
50
51
  return (
51
52
  <Button
52
53
  to={prettyLink}
@@ -11,9 +11,8 @@ const SellingPoints = ({ sellingPoints, icon, limit = 3 }) => {
11
11
  return (
12
12
  <ul className={styles.sellingPoint}>
13
13
  {sellingPoints.slice(0, limit).map((item) => (
14
- <li key={keygen()}>
15
- <span className={`${icon && styles.tick}`}>{` `}</span>
16
- <span>{item}</span>
14
+ <li className={`${icon && styles.tick}`} key={keygen()}>
15
+ {item}
17
16
  </li>
18
17
  ))}
19
18
  </ul>
@@ -7,7 +7,7 @@
7
7
  font-size: 1.4rem;
8
8
  width: 100%;
9
9
 
10
- .tick {
10
+ &.tick {
11
11
  position: relative;
12
12
  margin-left: 2rem;
13
13
  &::before {
@@ -16,7 +16,6 @@
16
16
  padding: 0px 0px .8rem .32rem;
17
17
  border-right-width: .18rem;
18
18
  border-bottom-width: .18rem;
19
- bottom: -.3rem;
20
19
  left: -1.8rem;
21
20
  }
22
21
  }
@@ -1,19 +1,14 @@
1
- .counterItem {
2
- @include flex-align(center, center);
3
- flex-direction: column;
4
-
5
- .title {
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
- .value {
14
- font: {
15
- weight: bold;
16
- size: 10rem;
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
- return (
10
- <li className={styles.counterItem}>
11
- <div className={styles.title}>{data.title}</div>
12
- <div className={styles.value}>
13
- {icon && icon}
14
- {/* run count up if the item is visible and has not counted up yet */}
15
- <LazyLoad>
16
- <CountNumber end={parseInt(data.value)} />
17
- </LazyLoad>
18
- </div>
19
- </li>
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({
@@ -8,6 +8,8 @@
8
8
  }
9
9
 
10
10
  li {
11
+ @include flex-align(center, center);
12
+ flex-direction: column;
11
13
  width: 40rem;
12
14
  height: 20rem;
13
15
  background: white;
@@ -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
- return (
12
- <>
13
- {module.content && (
14
- <p className={styles.counterContent} dangerouslySetInnerHTML={{ __html: module.content }} />
15
- )}
16
- <ul className={styles.counter}>
17
- {module.items.map((item) => {
18
- return <CounterItem data={item} key={keygen()} />;
19
- })}
20
- </ul>
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({
@@ -43,7 +43,14 @@ const Row = ({ item, oneliner = 'main', layout = 'list', tracker = 'main' }) =>
43
43
  height={40}
44
44
  />
45
45
  </a>
46
- <Bonus item={item} tracker={oneliner} />
46
+ <a
47
+ href={prettyLink}
48
+ target="_blank"
49
+ rel="noreferrer"
50
+ className="toplist-variant-one-gtm bonus-cta"
51
+ >
52
+ <Bonus item={item} tracker={oneliner} />
53
+ </a>
47
54
  <StarRating numOfStars={5} rating={itemRating} />
48
55
  <SellingPoints icon={<MdCheck />} sellingPoints={item.selling_points} />
49
56
  <div>
@@ -1,13 +1,26 @@
1
- .sliderWrapper {
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, sliderGap = 0 }) {
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
- <Slider
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
- </Slider>
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
 
@@ -13,6 +13,8 @@
13
13
  grid-template-columns: repeat(var(--cards-desktop-column), minmax(0,1fr));
14
14
  }
15
15
  column-gap: 0.8rem;
16
+ row-gap: 1rem;
17
+
16
18
  @include min(desktop) {
17
19
  column-gap: 1.6rem;
18
20
  }
@@ -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
- obj[
10
- token[1].replace(/-([a-z])/g, function (g) {
11
- return g[1].toUpperCase();
12
- })
13
- ] = token[2];
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, props) {
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]': (props && props.siteName) || '',
42
- '[title]': (props && props.siteTitle) || '',
41
+ '[sitename]': (data && data.siteName) || '',
42
+ '[title]': (data && data.pageTitle) || '',
43
43
  }[match])
44
44
  );
45
45
  }
@@ -32,7 +32,7 @@ describe('Generate Placeholders String', () => {
32
32
  null,
33
33
  {
34
34
  siteName: 'Site Name',
35
- siteTitle: 'Site Title',
35
+ pageTitle: 'Site Title',
36
36
  }
37
37
  );
38
38
  const date = new Date();
@@ -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
- // Get all pages by the selected page type
118
- const pagesGroupedByType = pagesCloned[pageType];
117
+ let pagesList = [];
119
118
 
120
- // Grouping pages by template ID
121
- if (!pagesGroupedByTemplateId[pageType]) {
122
- pagesGroupedByTemplateId[pageType] = groupBy(pagesGroupedByType, 'template_id');
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
- // Populate pagesList if page type and template exists
126
- const pagesList =
127
- !pagesGroupedByTemplateId[pageType] || !pagesGroupedByTemplateId[pageType][pageTemplateId]
128
- ? []
129
- : pagesGroupedByTemplateId[pageType][pageTemplateId];
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) {