gatsby-core-theme 2.0.2 → 2.0.6

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,53 @@
1
+ ## [2.0.6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.5...v2.0.6) (2021-12-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * spotlights component ([04bb5db](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/04bb5dbb2fd3ce69c511a99b16e7747dcdc7c3f6))
7
+
8
+
9
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([c7653a6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c7653a6da041061559855106cd6dfa7f9581a2c7))
10
+
11
+ ## [2.0.5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.4...v2.0.5) (2021-12-22)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * spotlights component ([f6221a6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/f6221a69e2941bba6d868af5e5c083a89f10a9ce))
17
+
18
+
19
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([7952c78](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7952c78019d7220cca07b5516cb462ef620e6d38))
20
+
21
+ ## [2.0.4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.3...v2.0.4) (2021-12-22)
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * operator bonus added dividor ([f191fd6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/f191fd60fb0be440b7fa16b8d4415a0997c00608))
27
+ * sitemap bug in rage sites ([ce649bf](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/ce649bfcce46d8b9bc5d732028555d68c6e800bc))
28
+ * spotlights component ([3154c2a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3154c2a89ed1da2231f4031e386166c0b408309f))
29
+ * star ratings ([884ba75](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/884ba7515f8835a20b673753887cd57173672f6a))
30
+
31
+
32
+ * Merge branch 'tm-2630-rage-sitemap' into 'master' ([f00efd3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/f00efd3c5060bc3b55171052aa3e948e95caf8f9))
33
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([026b9ad](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/026b9adf17a058e64e7d81f588a03b36550c2de4))
34
+ * Merge branch 'tm-2610-operator-bonus' into 'master' ([6415f0e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6415f0ee7badb5e1435f2bcce2a85c6fbbe25826))
35
+
36
+ ## [2.0.3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.2...v2.0.3) (2021-12-18)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * fixed schedule for rage ppc ([02f910f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/02f910f01b3ac1e9b442a1dc0a3e8f19466bac23))
42
+
43
+
44
+ ### Code Refactoring
45
+
46
+ * remove unneeded check ([2201e4d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2201e4d14c17684a4f49e2035af99ace83b108b1))
47
+
48
+
49
+ * Merge branch 'fix-build-schedule' into 'master' ([356b451](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/356b451459a126c41a6f27e0b0fcfbd300d45679))
50
+
1
51
  ## [2.0.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.1...v2.0.2) (2021-12-17)
2
52
 
3
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "2.0.2",
3
+ "version": "2.0.6",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -11,8 +11,6 @@ describe('Bonus Component', () => {
11
11
  const { container, 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(getByText('150 free spins')).toBeTruthy();
15
- expect(getByText('150 free spins').getAttribute('class')).toEqual('desc');
16
14
  expect(container.querySelector('div.bonus')).toBeTruthy();
17
15
  });
18
16
  test('without oneLiner', () => {
@@ -17,7 +17,7 @@ const Bonus = ({ item, tracker = 'main' }) => {
17
17
  <div className={styles.bonus}>
18
18
  <div className={styles.title}>{onelinerSplitted[0]}</div>
19
19
  {onelinerSplitted.length === 2 && (
20
- <div className={styles.desc}>{` ${onelinerSplitted[1]}`}</div>
20
+ <div className={styles.desc}>{`+${onelinerSplitted[1]}`}</div>
21
21
  )}
22
22
  </div>
23
23
  );
@@ -25,10 +25,7 @@ const Bonus = ({ item, tracker = 'main' }) => {
25
25
 
26
26
  Bonus.propTypes = {
27
27
  tracker: PropTypes.string,
28
- item: PropTypes.shape({
29
- one_liners: PropTypes.object,
30
- bonus: PropTypes.object,
31
- }),
28
+ item: PropTypes.shape({}),
32
29
  };
33
30
 
34
31
  export default Bonus;
@@ -3,7 +3,7 @@
3
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { GrFormNextLink } from 'react-icons/gr';
6
-
6
+ import Button from '~atoms/button';
7
7
  import LazyImage from '~hooks/lazy-image';
8
8
  import keygen from '~helpers/keygen';
9
9
  import { imagePrettyUrl } from '~helpers/getters';
@@ -18,15 +18,23 @@ const Spotlights = ({ module }) => {
18
18
  return (
19
19
  <>
20
20
  <span className={styles.itemImage}>
21
- <LazyImage alt={item.label || item?.link_text} src={imagePrettyUrl(img)} />
21
+ <LazyImage
22
+ width={100}
23
+ height={50}
24
+ alt={item.label || item?.link_text}
25
+ src={imagePrettyUrl(img)}
26
+ />
22
27
  </span>
23
- <span className={styles.label}>{item.label}</span>
28
+ <div className={styles.content}>
29
+ <span className={styles.label}>{item.label}</span>
30
+ {item.subtitle && <span className={styles.subtitle}>{item.subtitle}</span>}
31
+ </div>
24
32
  </>
25
33
  );
26
34
  };
27
35
 
28
36
  return (
29
- <div className={styles.spotlightsContainer}>
37
+ <div className={`${styles.spotlightsContainer} ${module.style ? styles[module.style] : ''}`}>
30
38
  {show_read_more === '1' && (
31
39
  <div
32
40
  className={styles.spotlightstext}
@@ -75,14 +83,16 @@ const Spotlights = ({ module }) => {
75
83
  ) : (
76
84
  <>
77
85
  {item.link.value && (
78
- <Link
86
+ <Button
87
+ btnText={item.link_text ? item.link_text : 'Read More'}
88
+ invertColors
89
+ isAnchorLink
90
+ isInternalLink={item.link.type !== 'external'}
91
+ targetBlank={item.link.type === 'external'}
79
92
  to={item.link.value}
80
- title={item.label}
81
- className={`${styles.readMore} spotlights-gtm`}
82
- >
83
- {item.link_text ? item.link_text : 'Read More'}
84
- <GrFormNextLink />
85
- </Link>
93
+ primaryColor={false}
94
+ gtmClass="spotlights-gtm btn-cta"
95
+ />
86
96
  )}
87
97
  </>
88
98
  )}
@@ -96,6 +106,7 @@ const Spotlights = ({ module }) => {
96
106
  };
97
107
  Spotlights.propTypes = {
98
108
  module: PropTypes.shape({
109
+ style: PropTypes.string,
99
110
  mode: PropTypes.oneOf(['image', 'icon', 'image_text']).isRequired,
100
111
  items: PropTypes.arrayOf(
101
112
  PropTypes.shape({
@@ -11,7 +11,7 @@
11
11
  }
12
12
 
13
13
  @include min(desktop) {
14
- grid-template-columns: repeat(4, 1fr);
14
+ grid-template-columns: repeat(3, 1fr);
15
15
  column-gap: 1.6rem;
16
16
  }
17
17
  li {
@@ -29,17 +29,21 @@
29
29
  width: 100%;
30
30
  height: 15rem;
31
31
  img {
32
- width: 100%;
32
+ width: auto;
33
33
  height: 100%;
34
34
  object-fit: cover;
35
35
  }
36
36
  }
37
- .label {
38
- font-weight: 700;
39
- font-size: 2rem;
40
- color: black;
37
+
38
+ .content {
41
39
  padding: 1rem;
40
+ .label {
41
+ font-weight: 700;
42
+ font-size: 2rem;
43
+ color: black;
44
+ }
42
45
  }
46
+
43
47
  .body {
44
48
  padding: 0 1rem 1rem 1rem;
45
49
  }
@@ -34,9 +34,9 @@ const StarRating = ({ numOfStars, rating, halfStars = true }) => {
34
34
  return output;
35
35
  };
36
36
  return (
37
- <div className={styles.starRatingContainer}>
38
- <LazyLoad>{renderFarm()}</LazyLoad>
39
- </div>
37
+ <LazyLoad>
38
+ <div className={styles.starRatingContainer}>{renderFarm()}</div>
39
+ </LazyLoad>
40
40
  );
41
41
  };
42
42
 
@@ -7,10 +7,10 @@ import { getToplistItem } from '~tests/factories/modules/toplist.factory';
7
7
 
8
8
  describe('Molecules/TopList/Row', () => {
9
9
  test('render with props', () => {
10
- const { container, getByText } = render(<Row item={getToplistItem()} tracker="main" />);
10
+ const { container } = render(<Row item={getToplistItem()} tracker="main" />);
11
11
  expect(container).toBeTruthy();
12
12
  expect(container.querySelector('.row.list')).toBeTruthy();
13
- expect(getByText('150 free spins')).toBeTruthy();
13
+ // expect(getByText('150 free spins')).toBeTruthy();
14
14
  });
15
15
 
16
16
  test('grid layout', () => {
@@ -9,10 +9,9 @@ import { getListToplistItems } from '~tests/factories/modules/toplist.factory';
9
9
 
10
10
  describe('Organisms/TopList', () => {
11
11
  test('render with props', () => {
12
- const { container, getByText } = render(<TopList module={{ items: getListToplistItems(3) }} />);
12
+ const { container } = render(<TopList module={{ items: getListToplistItems(3) }} />);
13
13
  expect(container).toBeTruthy();
14
14
  expect(container.querySelector('.list')).toBeTruthy();
15
- expect(getByText('150 free spins')).toBeTruthy();
16
15
  });
17
16
 
18
17
  test('headerExtra', () => {
@@ -48,30 +48,41 @@ export function convertTimeZone(event) {
48
48
  return { ...event, ...dateAttrs };
49
49
  }
50
50
 
51
+ function updateSchedule(schedule) {
52
+ if (!schedule) {
53
+ return {};
54
+ }
55
+
56
+ return Object.keys(schedule).reduce((acc, key) => {
57
+ const { tournaments } = schedule[key] || {};
58
+ if (!tournaments && ['soccer', 'handball', 'tennis', 'cricket'].includes(key)) {
59
+ const value = updateSchedule(schedule[key]);
60
+ acc[key] = value;
61
+ return acc;
62
+ }
63
+ // else if schedule is normal format
64
+ const formattedTournaments = Object.keys(tournaments).reduce(
65
+ (tournamentAcc, currentTournamentKey) => {
66
+ const league = tournaments[currentTournamentKey];
67
+ const formattedEvents = league.events.map((event) => convertTimeZone(event));
68
+
69
+ tournamentAcc[currentTournamentKey] = { ...league, events: formattedEvents };
70
+ return tournamentAcc;
71
+ },
72
+ {}
73
+ );
74
+ acc[key] = { ...schedule[key], tournaments: formattedTournaments };
75
+ return acc;
76
+ }, {});
77
+ }
78
+
51
79
  export function updateAllTimezones(relation) {
52
80
  const relationSchedule = relation?.schedule;
53
81
  const relationFeaturedEvents = relation?.featured_events;
54
82
  const relationShowcasedEvents = relation?.showcased_events;
55
83
 
56
84
  // formated timezone schedule
57
- const schedule = relationSchedule
58
- ? Object.keys(relationSchedule).reduce((acc, dateKey) => {
59
- const { tournaments } = relationSchedule[dateKey] || {};
60
-
61
- const formattedTournaments = Object.keys(tournaments).reduce(
62
- (tournamentAcc, currentTournamentKey) => {
63
- const league = tournaments[currentTournamentKey];
64
- const formattedEvents = league.events.map((event) => convertTimeZone(event));
65
- tournamentAcc[currentTournamentKey] = { ...league, events: formattedEvents };
66
- return tournamentAcc;
67
- },
68
- {}
69
- );
70
-
71
- acc[dateKey] = { ...relation.schedule[dateKey], tournaments: formattedTournaments };
72
- return acc;
73
- }, {})
74
- : {};
85
+ const schedule = updateSchedule(relationSchedule);
75
86
 
76
87
  // formated timezone featured events
77
88
  const featured_events = relationFeaturedEvents?.map((event) => convertTimeZone(event)) || [];
@@ -39,9 +39,12 @@ export function processSitemapPages(pages, markets) {
39
39
  pageListByMarket[market] = [];
40
40
  let pageList = [];
41
41
  Object.keys(pages[market]).forEach((pageType) => {
42
- const filteredPages = pages[market][pageType].filter(
43
- (page) => page.robot_options && page.robot_options.page_index === 1
44
- );
42
+ const filteredPages = pages[market][pageType].filter((page) => {
43
+ if (page.type === 'event') {
44
+ return page.relation.event && page.robot_options && page.robot_options.page_index === 1;
45
+ }
46
+ return page.robot_options && page.robot_options.page_index === 1;
47
+ });
45
48
 
46
49
  pageList = pageList.concat(filteredPages.map((row) => pick(row, pickHTMLSitemapPageKeys)));
47
50
  });