gatsby-core-theme 30.0.95 → 30.0.96

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,14 @@
1
+ ## [30.0.96](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.95...v30.0.96) (2024-03-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added shortcodes to fields ([7e33ab6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7e33ab633b90990659374c5558988395509d4b38))
7
+ * fixed tests ([54b389e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/54b389e46bc74aac43d4bd11aef99256f68d410d))
8
+
9
+
10
+ * Merge branch 'tm-4123-translatable-shortcodes' into 'master' ([a4c3609](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a4c3609b19968a9db4fd27ecd0e942bd3c73b487))
11
+
1
12
  ## [30.0.95](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.94...v30.0.95) (2024-03-05)
2
13
 
3
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "30.0.95",
3
+ "version": "30.0.96",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -21,49 +21,6 @@ describe('header component', () => {
21
21
  expect(container.querySelectorAll('footer')).toHaveLength(1);
22
22
  });
23
23
  });
24
- test('Template Two', async () => {
25
- const { container } = render(
26
- <Footer
27
- section={getFooterData()}
28
- template="homepage"
29
- hasFooterLinks={false}
30
- footerTemplate="template_two"
31
- />
32
- );
33
-
34
- await waitFor(() => {
35
- expect(container.querySelectorAll('.footer.templateOne')).toHaveLength(0);
36
- expect(container.querySelectorAll('.footer.templateTwo')).toHaveLength(1);
37
- expect(container.querySelectorAll('.footer.templateThree')).toHaveLength(0);
38
- });
39
- });
40
- test('Template Three', async () => {
41
- const { container } = render(
42
- <Footer
43
- section={getFooterData()}
44
- template="homepage"
45
- hasFooterLinks={false}
46
- footerTemplate="template_three"
47
- />
48
- );
49
-
50
- await waitFor(() => {
51
- expect(container.querySelectorAll('.footer.templateOne')).toHaveLength(0);
52
- expect(container.querySelectorAll('.footer.templateTwo')).toHaveLength(0);
53
- expect(container.querySelectorAll('.footer.templateThree')).toHaveLength(1);
54
- });
55
- });
56
- test('Default Template', async () => {
57
- const { container } = render(
58
- <Footer section={getFooterData()} template="homepage" hasFooterLinks={false} />
59
- );
60
-
61
- await waitFor(() => {
62
- expect(container.querySelectorAll('.footer.templateOne')).toHaveLength(1);
63
- expect(container.querySelectorAll('.footer.templateTwo')).toHaveLength(0);
64
- expect(container.querySelectorAll('.footer.templateThree')).toHaveLength(0);
65
- });
66
- });
67
24
  test('Test new responsible gaming logos', async () => {
68
25
  const { container } = render(
69
26
  <Footer section={getFooterData()} template="homepage" page={getPageData()} />
@@ -2,6 +2,7 @@
2
2
  import React from 'react';
3
3
  import loadable from '@loadable/component';
4
4
  import { getExtraField } from 'gatsby-core-theme/src/helpers/getters';
5
+ import { generatePlaceholderString } from 'gatsby-core-theme/src/helpers/generators.mjs';
5
6
 
6
7
  export const footerContent = (props) => {
7
8
  let ModuleComponent = null;
@@ -58,6 +59,22 @@ const Footer = (props) => {
58
59
  return refactoredFooterLogos;
59
60
  };
60
61
 
62
+ const helpline = () => {
63
+ if (getExtraField(props.section?.extra_fields, 'helpline')) {
64
+ return generatePlaceholderString(getExtraField(props.section?.extra_fields, 'helpline'));
65
+ }
66
+ return null;
67
+ };
68
+
69
+ const customCopyrightText = () => {
70
+ if (getExtraField(props.section?.extra_fields, 'copyright_text')) {
71
+ return generatePlaceholderString(
72
+ getExtraField(props.section?.extra_fields, 'copyright_text')
73
+ );
74
+ }
75
+ return null;
76
+ };
77
+
61
78
  props = {
62
79
  ...props,
63
80
  showLinks: props.template !== 'ppc',
@@ -75,8 +92,8 @@ const Footer = (props) => {
75
92
  dmcaHeight: 30,
76
93
  securityIcon: '../../../images/security.svg',
77
94
  helpText,
78
- phoneNum: getExtraField(props.section?.extra_fields, 'helpline') || null,
79
- copyrightCustomText: getExtraField(props.section?.extra_fields, 'copyright_text') || null,
95
+ phoneNum: helpline(),
96
+ copyrightCustomText: customCopyrightText(),
80
97
  };
81
98
 
82
99
  return footerContent(props);