gatsby-core-theme 42.0.22 → 42.0.24

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,17 @@
1
+ ## [42.0.24](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v42.0.23...v42.0.24) (2025-02-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * sports data ([a5d48e6](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/a5d48e6b8fbbc8ef30b2eeb7d60c66588e2c7019))
7
+
8
+ ## [42.0.23](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v42.0.22...v42.0.23) (2025-02-26)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * issue with authorbox missing link ([4d0d0f0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/4d0d0f095a8167276a629be404d9ff26f545fcab))
14
+
1
15
  ## [42.0.22](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v42.0.21...v42.0.22) (2025-02-25)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "42.0.22",
3
+ "version": "42.0.24",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react-hooks/rules-of-hooks */
1
2
  import React from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { imagePrettyUrl, getAltText } from '~helpers/getters';
@@ -29,10 +30,18 @@ export default function AuthorDetails({
29
30
  />
30
31
  )}
31
32
  <div className={styles.information || ''}>
32
- <Link to={author?.profile_page_path} className={`${styles.name || ''} author-gtm`}>
33
- <span>{author?.name}</span>
34
- <FactCheckIcon width={verifiedIconWidth} height={verifiedIconHeight} color="#457BF9" />
35
- </Link>
33
+ {author?.profile_page_path ? (
34
+ <Link to={author?.profile_page_path} className={`${styles.name || ''} author-gtm`}>
35
+ <span>{author?.name}</span>
36
+ <FactCheckIcon width={verifiedIconWidth} height={verifiedIconHeight} color="#457BF9" />
37
+ </Link>
38
+ ) : (
39
+ <div to={author?.profile_page_path} className={`${styles.name || ''} author-gtm`}>
40
+ <span>{author?.name}</span>
41
+ <FactCheckIcon width={verifiedIconWidth} height={verifiedIconHeight} color="#457BF9" />
42
+ </div>
43
+ )}
44
+
36
45
  <div className={styles.ribbonAndExpert}>
37
46
  {author?.author_title && <p className={styles.title || ''}>{author?.author_title}</p>}
38
47
  {author?.ribbon_label && ribbon && (
@@ -19,7 +19,7 @@ export function extractParticipantIds(participantsData) {
19
19
  }
20
20
 
21
21
  function modifyMarketEvents(sportsMarketData, data, market) {
22
- const events = cloneDeep(sportsMarketData.events);
22
+ const events = sportsMarketData ? cloneDeep(sportsMarketData.events) : {};
23
23
 
24
24
  if (data.site_markets[market].path_prefix) {
25
25
  Object.keys(events).map((eventkey) => {
@@ -110,7 +110,7 @@ export const processSportsRelations = (
110
110
  ) {
111
111
  transformedPages[market][pageType][index].relation_id.map(
112
112
  (tournament) => {
113
- if (sportsMarketData.tournaments[tournament]) {
113
+ if (sportsMarketData && sportsMarketData.tournaments[tournament]) {
114
114
  Object.assign(tournaments, {[sportsMarketData.tournaments[tournament].id]: cloneDeep(sportsMarketData.tournaments[tournament])});
115
115
  tournamentIds.push(sportsMarketData.tournaments[tournament].id);
116
116
  }
@@ -133,9 +133,9 @@ export const processSportsRelations = (
133
133
  }
134
134
 
135
135
  // Filter schedule tournaments
136
- const schedule = cloneDeep(sportsMarketData.schedule);
136
+ const schedule = sportsMarketData ? cloneDeep(sportsMarketData.schedule) : {};
137
137
 
138
- if (schedule.soccer) {
138
+ if (schedule && schedule.soccer) {
139
139
  Object.entries(schedule.soccer).forEach(([date, value]) => {
140
140
  Object.entries(value.tournaments).forEach(([tournamentId, value]) => {
141
141
  if (!tournamentIds.includes(parseInt(tournamentId))) {
@@ -151,21 +151,21 @@ export const processSportsRelations = (
151
151
 
152
152
  relation.teams = cloneDeep(data.relations.sports_data.teams);
153
153
  relation.events = events;
154
- relation.schedule = filterScheduleByDate(schedule);
154
+ relation.schedule = schedule && schedule.soccer ? filterScheduleByDate(schedule) : {};
155
155
  relation.tournaments = tournaments;
156
156
 
157
- const allFeaturedEvents = Object.keys(sportsMarketData.events).filter(
157
+ const allFeaturedEvents = sportsMarketData ? Object.keys(sportsMarketData.events).filter(
158
158
  (id) => sportsMarketData.events[id].featured === 1
159
- );
159
+ ) : null;
160
160
 
161
161
 
162
162
 
163
163
  if(page.template === 'tournament') {
164
- relation.featured_events = allFeaturedEvents.filter((id) =>
164
+ relation.featured_events = allFeaturedEvents ? allFeaturedEvents.filter((id) =>
165
165
  tournaments.length > 0 && tournaments[0] && tournaments[0].events
166
166
  ? tournaments[0].events.includes(parseInt(id))
167
167
  : false
168
- );
168
+ ) : {};
169
169
  }
170
170
 
171
171
  transformedPages[market][pageType][index].relation = relation;