gatsby-core-theme 7.0.2 → 7.0.5

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,45 @@
1
+ ## [7.0.5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v7.0.4...v7.0.5) (2022-05-18)
2
+
3
+
4
+ ### Code Refactoring
5
+
6
+ * operatorCTA styles ([07b8b78](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/07b8b78a2b99cf366cbd0f07d33381cd181a4f82))
7
+
8
+
9
+ * Merge branch 'tm-2819-operator-placeholder' into 'master' ([1883a89](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/1883a8916d74412193829528b803d1949b9e7124))
10
+
11
+ ## [7.0.4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v7.0.3...v7.0.4) (2022-05-17)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * fix bug when we don't have the post type what is selected ([e5676fe](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e5676fed6d558caa83edf9a7db70b9f17d29d1f5))
17
+
18
+
19
+ ### Code Refactoring
20
+
21
+ * add loading eager to image ([03f5049](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/03f5049d17ec540f02f779eac0462a941bb0b238))
22
+ * add width and height to lazy image ([3177e0b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3177e0b9e5affe747823fa5ff4044023e6ba1a7d))
23
+ * correction to coming soon casino translation key ([28cbea5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/28cbea5f8a3163c54b524b99fa8955d867400b95))
24
+ * correction to duplicate ([cea1daf](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cea1daf727d94a2601e95299aa43f370aa7cdd08))
25
+ * operatorCTA placeholder changes ([b35c777](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b35c777918275fc6153ad38b43eb8fa92d32c547))
26
+ * remove width and height ([8472e2d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8472e2db10981631681e7a3d0c8b4b8987cc8257))
27
+
28
+
29
+ * Merge branch 'tm-2893-operator-img-fix' into 'master' ([17c5061](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/17c5061216dbf8fc72cce6e94906b3821c9c0eb7))
30
+ * Merge branch 'tm-2819-operator-placeholder' into 'master' ([e483605](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e483605921a4d99c92abdf0a0c447c2e3e5c43b2))
31
+ * Merge branch 'tm-2884-archive-module' into 'master' ([935cd5e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/935cd5ec1bed85a616c819e264e98ffb852cd65e))
32
+
33
+ ## [7.0.3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v7.0.2...v7.0.3) (2022-05-11)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * page reviewer ([0daf457](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0daf457df31c997333460113ca224e203a801afe))
39
+
40
+
41
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([1ccca2d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/1ccca2d8729416b5f5ad8dfb904471cd2cb3c90b))
42
+
1
43
  ## [7.0.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v7.0.1...v7.0.2) (2022-05-11)
2
44
 
3
45
 
@@ -45,10 +45,8 @@ function createArchivePage(pageObject, marketSections, prefilledModules, createP
45
45
  }
46
46
  });
47
47
  }
48
-
49
48
  if (!archivePages) {
50
49
  console.log(`Archive for ${pageObject.path} broken`);
51
- return;
52
50
  }
53
51
 
54
52
  if (archiveModule.pagination_type !== 'load_more') {
@@ -57,28 +55,37 @@ function createArchivePage(pageObject, marketSections, prefilledModules, createP
57
55
  const numOfItemsPerPage = Math.sign(archiveModule.num_of_items)
58
56
  ? archiveModule.num_of_items
59
57
  : calDefaultNrOfItems;
60
- const chunked = chunk(cloneDeep(archivePages), numOfItemsPerPage);
61
- const numOfPages = chunked.length;
62
- chunked.forEach((value, index) => {
63
- const page = cloneDeep(pageObject);
64
- const archive = cloneDeep(page.sections.main.modules[archiveModuleIndex]);
65
- archive.currentPage = 1 + index; // 0 skip 0
66
- archive.numOfPages = numOfPages;
67
- archive.rootPath =
68
- pageObject.path.charAt(0) !== '/' ? `/${pageObject.path}` : pageObject.path;
69
- archive.items = value.map((item) => processor.clonePage(item));
70
- page.path =
71
- archive.currentPage === 1
72
- ? pageObject.path
73
- : `${pageObject.path}/page/${archive.currentPage}`;
74
- page.sections.main.modules[archiveModuleIndex] = archive;
58
+ const chunked = archivePages && chunk(cloneDeep(archivePages), numOfItemsPerPage);
59
+ const page = cloneDeep(pageObject);
60
+
61
+ if (chunked) {
62
+ chunked.forEach((value, index) => {
63
+ const numOfPages = chunked.length;
64
+ const archive = cloneDeep(page.sections.main.modules[archiveModuleIndex]);
65
+ archive.currentPage = 1 + index; // 0 skip 0
66
+ archive.numOfPages = numOfPages;
67
+ archive.rootPath =
68
+ pageObject.path.charAt(0) !== '/' ? `/${pageObject.path}` : pageObject.path;
69
+ archive.items = value.map((item) => processor.clonePage(item));
70
+ page.path =
71
+ archive.currentPage === 1
72
+ ? pageObject.path
73
+ : `${pageObject.path}/page/${archive.currentPage}`;
74
+ page.sections.main.modules[archiveModuleIndex] = archive;
75
75
 
76
+ createPage({
77
+ path: page.path,
78
+ component: require.resolve(appName),
79
+ context: { page, marketSections, prefilledModules, siteInfo, translations },
80
+ });
81
+ });
82
+ } else {
76
83
  createPage({
77
84
  path: page.path,
78
85
  component: require.resolve(appName),
79
86
  context: { page, marketSections, prefilledModules, siteInfo, translations },
80
87
  });
81
- });
88
+ }
82
89
  } else {
83
90
  const page = cloneDeep(pageObject);
84
91
  const archive = cloneDeep(page.sections.main.modules[archiveModuleIndex]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "7.0.2",
3
+ "version": "7.0.5",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -57,7 +57,7 @@ const Author = ({
57
57
  )}
58
58
  </div>
59
59
  <div>
60
- {reviewer.name && (
60
+ {reviewer && (
61
61
  <div className={date && styles.reviewer}>
62
62
  <span>Fact checked by</span>
63
63
  {` `}
@@ -9,8 +9,8 @@ import styles from './operator-cta.module.scss';
9
9
 
10
10
  export default function OperatorCta({
11
11
  operator,
12
- placeholderText = 'Coming Soon',
13
- closedCasinoText = 'This Casino has closed',
12
+ placeholderText = 'Soon Available',
13
+ closedCasinoText = 'Not Accepting New Players',
14
14
  playText = 'Visit',
15
15
  translationKey = 'play_now',
16
16
  tracker = 'main',
@@ -21,26 +21,20 @@ export default function OperatorCta({
21
21
  const isPlaceHolder = status === 'coming_soon';
22
22
  const isClosed = status === 'inactive';
23
23
  const renderCta = () => {
24
- if (isPlaceHolder) {
25
- return (
26
- <a
27
- title={placeholderText}
28
- aria-label={placeholderText}
29
- className={`${styles.operatorCtaPlaceholder} ${gtmClass} operator-cta-gtm`}
30
- >
31
- {placeholderText}
32
- </a>
33
- );
34
- }
24
+ if (isPlaceHolder || isClosed) {
25
+ const translateBtn = isPlaceHolder
26
+ ? translate(translations, 'coming_soon', placeholderText)
27
+ : translate(translations, 'closed_casino', closedCasinoText);
35
28
 
36
- if (isClosed) {
37
29
  return (
38
30
  <a
39
- title={closedCasinoText}
40
- aria-label={closedCasinoText}
41
- className={`${styles.operatorCtaClosed} ${gtmClass} operator-cta-gtm`}
31
+ title={translateBtn}
32
+ aria-label={translateBtn}
33
+ className={`${
34
+ isPlaceHolder ? styles.operatorCtaClosed : styles.operatorCtaPlaceholder
35
+ } ${gtmClass} operator-cta-gtm`}
42
36
  >
43
- {closedCasinoText}
37
+ {translateBtn}
44
38
  </a>
45
39
  );
46
40
  }
@@ -63,7 +63,7 @@ function Header({ section, content = null, backgroundImage = true }) {
63
63
  name={section.page.author?.name}
64
64
  date={section.page.updated_at ? section.page.updated_at : section.page.created_at}
65
65
  readingTime={section.page.reading_time}
66
- reviewer={section.page.reviewer}
66
+ reviewer={section?.page.reviewer_id && section?.page?.reviewer}
67
67
  />
68
68
  </div>
69
69
  )}
@@ -90,6 +90,7 @@ Header.propTypes = {
90
90
  created_at: PropTypes.string,
91
91
  reading_time: PropTypes.string,
92
92
  reviewer: PropTypes.string,
93
+ reviewer_id: PropTypes.number,
93
94
  author: PropTypes.shape({
94
95
  name: PropTypes.string,
95
96
  profile_page_path: PropTypes.string,
@@ -49,7 +49,13 @@ export default function OperatorBanner({
49
49
  rel="noreferrer"
50
50
  aria-label={`${operator?.name} Link`}
51
51
  >
52
- <LazyImage alt={operator?.name} src={imagePrettyUrl(logo)} />
52
+ <LazyImage
53
+ alt={operator?.name}
54
+ src={imagePrettyUrl(logo)}
55
+ loading="eager"
56
+ height={120}
57
+ width={100}
58
+ />
53
59
  </a>
54
60
  ) : (
55
61
  <div className={styles.nameTitle}>