gatsby-core-theme 2.0.16 → 2.1.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/CHANGELOG.md CHANGED
@@ -1,3 +1,64 @@
1
+ # [2.1.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.19...v2.1.0) (2022-01-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added dmca as component ([2aae7bc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2aae7bc3cf0d8ba1210154ad0f7aecd24221c92d))
7
+ * added lazyload and image added as prop ([71b7ad7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/71b7ad70f0499a09eeada813fce007c273c99422))
8
+ * test ([d103191](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d103191b379926afd7ae9effcd29f0cbe61d9c28))
9
+
10
+
11
+ ### Code Refactoring
12
+
13
+ * update counter and counterItem for w3 validator ([9ebbcdc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9ebbcdcbe14f0a5adf8ca6acedfbe1c7c7b19ec3))
14
+ * update css parser for w3 validator ([db7dd7d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/db7dd7d76f3d0404a19471bdf45e883bff635512))
15
+
16
+
17
+ * Merge branch 'tm-2654-open-graph' into 'master' ([0e2a375](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0e2a37579483adde033aa19e58b677fa80e75f3a))
18
+ * Merge branch 'tm-2567-update-theme-for-w3-validator' into 'master' ([cb0ab99](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cb0ab990a56d26a7591bb089d2ed38f001b0cc74))
19
+ * Merge branch 'tm-2625-dmca-implementation' into 'master' ([8cb7230](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8cb7230734fb97c2222ebb8207c646206ab9d92c))
20
+ * 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))
21
+
22
+
23
+ ### Features
24
+
25
+ * added new og properties ([2aba269](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2aba2697f9f80b1326e0118a8bf80f50f52e721f))
26
+
27
+ ## [2.0.19](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.18...v2.0.19) (2022-01-11)
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * bonus and selleing points extra divs ([892d6a4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/892d6a4542efeb16717136472b0422ca5e089ca8))
33
+ * make key dynamic cta ([a7b883c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a7b883cfa2010d5e95d54137e1cb7f86a92115ac))
34
+
35
+
36
+ * Merge branch 'tm-2473-lottery-fixes' into 'master' ([fbc331c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/fbc331c1d3f8ff3276b56e518e6de3e359393fc2))
37
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([86b2be9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/86b2be99241420c6fb77fb3bea3e22f69a1ddb98))
38
+
39
+ ## [2.0.18](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.17...v2.0.18) (2022-01-10)
40
+
41
+
42
+ ### Config
43
+
44
+ * reverted gatsby upgrade ([4155578](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/415557860165a0e9fa5a327470cea2570d0d57ed))
45
+
46
+ ## [2.0.17](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.16...v2.0.17) (2022-01-10)
47
+
48
+
49
+ ### Bug Fixes
50
+
51
+ * removing cards extra divs ([7096d88](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7096d88b480a43d4d8bd5245cf403b07f194fae0))
52
+ * updated html parser package ([332b237](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/332b237bc728bfe57766fab1bced598ad18ceeb6))
53
+
54
+
55
+ ### Config
56
+
57
+ * updated gatsby packages ([cdfc9c3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cdfc9c3681db2603061b0fcc1f4ef634ce12e7a1))
58
+
59
+
60
+ * Merge branch 'upgrade' into 'master' ([e38a936](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e38a936bc76221072c5d0e89c66fccd3df3cbad7))
61
+
1
62
  ## [2.0.16](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.15...v2.0.16) (2022-01-05)
2
63
 
3
64
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "2.0.16",
3
+ "version": "2.1.0",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -45,7 +45,7 @@
45
45
  "gatsby-plugin-webfonts": "^2.1.0",
46
46
  "gatsby-source-filesystem": "^3.3.0",
47
47
  "gatsby-transformer-sharp": "^3.3.0",
48
- "html-react-parser": "^1.2.5",
48
+ "html-react-parser": "^1.3.0",
49
49
  "js-search": "^2.0.0",
50
50
  "lodash": "^4.17.15",
51
51
  "node-sass": "5.0.0",
@@ -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('.lazyload-placeholder')).toHaveLength(1);
19
+ expect(container.querySelector('div')).toBeTruthy();
20
+ });
21
+ });
22
+ afterEach(() => {
23
+ cleanup();
24
+ });
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import LazyLoad from 'react-lazyload';
4
+
5
+ const Disclaimer = ({ image }) => (
6
+ <LazyLoad>
7
+ <a
8
+ href="//www.dmca.com/Protection/Status.aspx?ID=9e466e76-827d-4247-ac51-4eb75b227301"
9
+ title="DMCA.com Protection Status"
10
+ className="dmca-badge"
11
+ target="_blank"
12
+ rel="noreferrer"
13
+ >
14
+ {image}
15
+ </a>
16
+ <script src="https://images.dmca.com/Badges/DMCABadgeHelper.min.js"> </script>
17
+ </LazyLoad>
18
+ );
19
+
20
+ export default Disclaimer;
21
+
22
+ Disclaimer.propTypes = {
23
+ image: PropTypes.node,
24
+ };
@@ -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>
19
+ <CounterItem data={item} key={keygen()} />;
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>
@@ -12,6 +12,7 @@ const CardsGridStyles = ({
12
12
  mobileColumns = 2,
13
13
  tabletColumns = 3,
14
14
  desktopColumns = 4,
15
+ className = '',
15
16
  }) => {
16
17
  const divStyle = {
17
18
  '--cards-mob-column': `${
@@ -24,10 +25,15 @@ const CardsGridStyles = ({
24
25
  module.desktop_num_of_columns ? module.desktop_num_of_columns : desktopColumns
25
26
  }`,
26
27
  };
27
- return <div style={divStyle}>{children}</div>;
28
+ return (
29
+ <div className={className} style={divStyle}>
30
+ {children}
31
+ </div>
32
+ );
28
33
  };
29
34
 
30
35
  CardsGridStyles.propTypes = {
36
+ className: PropTypes.string,
31
37
  module: PropTypes.shape({
32
38
  mobile_num_of_columns: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
33
39
  tablet_num_of_columns: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -53,25 +59,23 @@ const Cards = ({
53
59
  desktopColumns={desktopColumns}
54
60
  tabletColumns={tabletColumns}
55
61
  mobileColumns={mobileColumns}
62
+ className={styles.cardsContainer}
56
63
  >
57
- <div className={styles.cardsContainer}>
58
- {module.items &&
59
- module.items.map((item, index) => (
60
- <div key={keygen()}>
61
- {CustomCardComponent ? (
62
- <CustomCardComponent
63
- featured={module.style === 'featured'}
64
- item={item}
65
- type={item.type}
66
- number={index + 1}
67
- page={page}
68
- />
69
- ) : (
70
- <Card item={item} />
71
- )}
72
- </div>
73
- ))}
74
- </div>
64
+ {module.items &&
65
+ module.items.map((item, index) =>
66
+ CustomCardComponent ? (
67
+ <CustomCardComponent
68
+ key={keygen()}
69
+ featured={module.style === 'featured'}
70
+ item={item}
71
+ type={item.type}
72
+ number={index + 1}
73
+ page={page}
74
+ />
75
+ ) : (
76
+ <Card key={keygen()} item={item} />
77
+ )
78
+ )}
75
79
  </CardsGridStyles>
76
80
  );
77
81
 
@@ -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
  });