gatsby-core-theme 40.0.4 → 40.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,30 @@
1
+ ## [40.0.6](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v40.0.5...v40.0.6) (2024-10-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * content image ([26c5ad8](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/26c5ad8eae52a567dc1f5e43132becd4625380ca))
7
+ * test ([1b6ffca](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/1b6ffca0e867d7378761a753f191f8e33ee93bc9))
8
+ * update min width of tables ([5d42c8c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5d42c8c6c006e36fb23aa1fe708e996beb53fa4b))
9
+
10
+
11
+ * Merge branch 'tm-4346-content-image' into 'master' ([7f0da68](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/7f0da6808793f9206e34f1846b0ef49ee0eebbe7))
12
+ * Merge branch 'tm-4854-table-issue' into 'master' ([97789fd](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/97789fdb6ddf41d58c31d2f1cee943f99ab7f5e9))
13
+
14
+ ## [40.0.5](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v40.0.4...v40.0.5) (2024-10-16)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * align with the current master ([4c4284a](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/4c4284ab1196266b45f6f30acc84b6ac98c970f4))
20
+ * content module images with data size ([daa7c0f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/daa7c0f5ef0b9a241811ecf2bb0be6bf24d5c95e))
21
+ * new images path ([1b7bfb0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/1b7bfb0569fdd4040373c2a3cb0be7d21789a4b0))
22
+ * preview ([83d0c2f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/83d0c2f6610c926eae74030d12cd19581176a908))
23
+ * preview feature ([37c64ed](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/37c64ed1b1180e9f4258f7d654ace2dbd931f0aa))
24
+
25
+
26
+ * Merge branch 'tm-4346-content-modules' into 'master' ([5392b4f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5392b4f946755c1219567afa463af6cb99615af1))
27
+
1
28
  ## [40.0.4](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v40.0.3...v40.0.4) (2024-10-15)
2
29
 
3
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "40.0.4",
3
+ "version": "40.0.6",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -136,7 +136,9 @@ const AdminBar = ({ page, marketSections, menu }) => {
136
136
  )}
137
137
  </li>
138
138
  <li>
139
- <span className={`${styles.label} ${styles.labelBorder}`}>Footer Section</span>
139
+ <span className={`${styles.label} ${styles.labelBorder}`}>
140
+ Footer Section
141
+ </span>
140
142
  </li>
141
143
  {footerExtraFields && getFooterLinks(footerExtraFields)}
142
144
  </ul>
@@ -168,7 +170,12 @@ const AdminBar = ({ page, marketSections, menu }) => {
168
170
  className={`${styles.menuItem} ${styles.preview} ${
169
171
  !preview ? styles.previewOff : ""
170
172
  }`}
171
- href={!preview ? `/preview/?path=${page.path}&market_id=${page.market_id}` : `${page.path}`}
173
+ target={!preview ? "_blank" : ""}
174
+ href={
175
+ !preview
176
+ ? `/preview/?path=${page.path}&market_id=${page.market_id}`
177
+ : `/${page.path}`
178
+ }
172
179
  rel="noreferrer"
173
180
  >
174
181
  {preview ? "Preview Mode On" : "Preview Mode Off"}
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-restricted-syntax */
1
2
  import React from 'react';
2
3
  import { render, cleanup } from '@testing-library/react';
3
4
  import '@testing-library/jest-dom/extend-expect';
@@ -7,17 +8,17 @@ import ContentBox from '.';
7
8
  const info = [
8
9
  {
9
10
  title: 'Fully licensed casinos',
10
- image: '../../../images/content-1.png',
11
+ image: '/images/content-1.png',
11
12
  text: 'We only list and review fully licensed and legally operating casinos so you can be sure where you end up playing will be safe and secure.',
12
13
  },
13
14
  {
14
15
  title: 'Get the most for your money',
15
- image: '../../../images/content-2.png',
16
+ image: '/images/content-2.png',
16
17
  text: 'We list all the features the Casinos have to offer so you can make an educated decision about where to place your money for maximum gains!',
17
18
  },
18
19
  {
19
20
  title: 'Authenticly written articles',
20
- image: '../../../images/content-3.png',
21
+ image: '/images/content-3.png',
21
22
  text: 'All our Authors are professional writers with industry know-how, so you can depend on what we say is the truth!',
22
23
  },
23
24
  ];
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable no-unused-expressions */
2
+ /* eslint-disable no-restricted-syntax */
2
3
  import React from 'react';
3
4
  import { render, cleanup, fireEvent } from '@testing-library/react';
4
5
  import '@testing-library/jest-dom/extend-expect';
@@ -9,10 +10,10 @@ describe('Disclaimer Component', () => {
9
10
  // eslint-disable-next-line global-require
10
11
  const func = require('../../../helpers/device-detect');
11
12
  func.isNativeImageLazyLoadingSupported = jest.fn(() => true);
12
- const { container } = render(<Disclaimer dmcaImage="../../../../../images/dmca.png" />);
13
+ const { container } = render(<Disclaimer dmcaImage="/images/dmca.png" />);
13
14
 
14
15
  expect(container.querySelector('img')).toBeTruthy();
15
- expect(container.querySelector('img')).toHaveAttribute('src', '../../../../../images/dmca.png');
16
+ expect(container.querySelector('img')).toHaveAttribute('src', '/images/dmca.png');
16
17
  expect(container.querySelector('img')).toHaveAttribute('loading', 'eager');
17
18
 
18
19
  const Button = container.querySelector('a');
@@ -1,3 +1,4 @@
1
+ /* stylelint-disable */
1
2
  @mixin tableStyles {
2
3
  width: 100% !important;
3
4
  border: none;
@@ -10,6 +11,7 @@
10
11
  display: block;
11
12
  box-shadow: var(--table-box-shadow, 0px 4px 6px -2px rgba(27, 27, 28, 0.02), 0px 12px 16px -4px rgba(27, 27, 28, 0.05));
12
13
  padding-bottom: 2.4rem;
14
+ min-width: 100% !important;
13
15
 
14
16
  &::-webkit-scrollbar {
15
17
  height: 0.6rem;
@@ -25,7 +27,7 @@
25
27
  &::-webkit-scrollbar-track {
26
28
  background: #e0e0e2;
27
29
  border-radius: 100px;
28
- opacity: 0.20000000298023224;
30
+ opacity: 0.2;
29
31
  }
30
32
  @include scrollbar(
31
33
  var(--scroll-height-1, 0.8rem),
@@ -22,7 +22,7 @@ const CookieModal = ({
22
22
  title: '',
23
23
  path: '',
24
24
  },
25
- logo = '../../../../../images/logo.svg',
25
+ logo = '/images/logo.svg',
26
26
  templateTwo = false,
27
27
  hide,
28
28
  }) => {
@@ -79,8 +79,8 @@ const Footer = (props) => {
79
79
  asSeenOn: getExtraField(section?.extra_fields, 'as_seen_on'),
80
80
  gamblingText: getExtraField(section?.extra_fields, 'gambling_text'),
81
81
  socialIcons: getExtraField(section?.extra_fields, 'social_icons'),
82
- logo: '../../../images/logo.svg',
83
- dmcaImage: '../../../images/dmca.png',
82
+ logo: '/images/logo.svg',
83
+ dmcaImage: '/images/dmca.png',
84
84
  dmcaWidth: 100,
85
85
  dmcaHeight: 30,
86
86
  securityIcon: <Security />,
@@ -25,7 +25,7 @@ const TemplateOne = ({
25
25
  showCopyright,
26
26
  helpText,
27
27
  phoneNum,
28
- logo = '../../../../../images/logo.svg',
28
+ logo = '/images/logo.svg',
29
29
  dmcaImage,
30
30
  dmcaWidth,
31
31
  dmcaHeight,
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-restricted-syntax */
1
2
  import React from 'react';
2
3
  import { render, cleanup, waitFor } from '@testing-library/react';
3
4
  import '@testing-library/jest-dom/extend-expect';
@@ -63,7 +64,7 @@ beforeEach(() => {
63
64
  socialIcons,
64
65
  hasDisclaimer: true,
65
66
  showCopyright: true,
66
- logo: '../../../../../images/logo.svg',
67
+ logo: '/images/logo.svg',
67
68
  securityIcon: <Security />,
68
69
  helpText,
69
70
  phoneNum,
@@ -200,13 +201,13 @@ describe('Show Footer', () => {
200
201
  props = {
201
202
  ...props,
202
203
  showCopyright: false,
203
- dmcaImage: '../../../images/dmca.png',
204
+ dmcaImage: '/images/dmca.png',
204
205
  };
205
206
  const { container } = renderComponent(props);
206
207
  expect(container.querySelector('.logos > a').querySelector('img')).toBeTruthy();
207
208
  expect(container.querySelector('.logos > a').querySelector('img')).toHaveAttribute(
208
209
  'src',
209
- '../../../images/dmca.png'
210
+ '/images/dmca.png'
210
211
  );
211
212
  expect(container.querySelector('.logos > a').querySelector('img')).toHaveAttribute(
212
213
  'loading',
@@ -24,7 +24,7 @@ const TemplateThree = ({
24
24
  showCopyright,
25
25
  helpText,
26
26
  phoneNum,
27
- logo = '../../../../../images/logo.svg',
27
+ logo = '/images/logo.svg',
28
28
  dmcaImage,
29
29
  dmcaWidth,
30
30
  dmcaHeight,
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-restricted-syntax */
1
2
  import React from 'react';
2
3
  import { render, cleanup, waitFor } from '@testing-library/react';
3
4
  import '@testing-library/jest-dom/extend-expect';
@@ -77,7 +78,7 @@ beforeEach(() => {
77
78
  socialIcons,
78
79
  hasDisclaimer: true,
79
80
  showCopyright: true,
80
- logo: '../../../../../images/logo.svg',
81
+ logo: '/images/logo.svg',
81
82
  securityIcon: <Security />,
82
83
  helpText,
83
84
  phoneNum,
@@ -223,13 +224,13 @@ describe('Show template one', () => {
223
224
  props = {
224
225
  ...props,
225
226
  showCopyright: false,
226
- dmcaImage: '../../../../../images/dmca.png',
227
+ dmcaImage: '/images/dmca.png',
227
228
  };
228
229
  const { container } = renderComponent(props);
229
230
  expect(container.querySelector('.logos > a').querySelector('img')).toBeTruthy();
230
231
  expect(container.querySelector('.logos > a').querySelector('img')).toHaveAttribute(
231
232
  'src',
232
- '../../../../../images/dmca.png'
233
+ '/images/dmca.png'
233
234
  );
234
235
  expect(container.querySelector('.logos > a').querySelector('img')).toHaveAttribute(
235
236
  'loading',
@@ -23,7 +23,7 @@ const TemplateTwo = ({
23
23
  showCopyright,
24
24
  helpText,
25
25
  phoneNum,
26
- logo = '../../../../../images/logo.svg',
26
+ logo = '/images/logo.svg',
27
27
  dmcaImage,
28
28
  dmcaWidth,
29
29
  dmcaHeight,
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-restricted-syntax */
1
2
  import React from 'react';
2
3
  import { render, cleanup, waitFor } from '@testing-library/react';
3
4
  import '@testing-library/jest-dom/extend-expect';
@@ -76,7 +77,7 @@ beforeEach(() => {
76
77
  socialIcons,
77
78
  hasDisclaimer: true,
78
79
  showCopyright: true,
79
- logo: '../../../../../images/logo.svg',
80
+ logo: '/images/logo.svg',
80
81
  securityIcon: <Security />,
81
82
  helpText,
82
83
  phoneNum,
@@ -222,13 +223,13 @@ describe('Show template one', () => {
222
223
  props = {
223
224
  ...props,
224
225
  showCopyright: false,
225
- dmcaImage: '../../../../../images/dmca.png',
226
+ dmcaImage: '/images/dmca.png',
226
227
  };
227
228
  const { container } = renderComponent(props);
228
229
  expect(container.querySelector('.logos > a').querySelector('img')).toBeTruthy();
229
230
  expect(container.querySelector('.logos > a').querySelector('img')).toHaveAttribute(
230
231
  'src',
231
- '../../../../../images/dmca.png'
232
+ '/images/dmca.png'
232
233
  );
233
234
  expect(container.querySelector('.logos > a').querySelector('img')).toHaveAttribute(
234
235
  'loading',
@@ -14,7 +14,7 @@ const CookieConsent = ({
14
14
  settingsCookie,
15
15
  children,
16
16
  cookieName = 'CookieConsent',
17
- logo = '../../../../../images/logo.svg',
17
+ logo = '/images/logo.svg',
18
18
  icon = null,
19
19
  }) => {
20
20
  const [showModal, setShowModal] = useState(false);
@@ -25,7 +25,7 @@ const Navigation = ({
25
25
  mobileAnimation = "collapseFull",
26
26
  stopScrollOnOpen = true,
27
27
  canOpenAllSubMenus = true,
28
- logo = "../../../../../images/logo.svg",
28
+ logo = "/images/logo.svg",
29
29
  logoWidth = 200,
30
30
  logoHeight = 31,
31
31
  searchIcon = null,
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable react-hooks/rules-of-hooks */
2
2
  /* eslint-disable react/prop-types */
3
3
  /* eslint-disable react/forbid-prop-types */
4
+ /* eslint-disable no-console */
4
5
  import React, { useEffect } from 'react';
5
6
  import PropTypes from 'prop-types';
6
7
  import Button from '~atoms/button/button';
@@ -19,7 +20,7 @@ const Tracker = ({
19
20
  bgImage = '',
20
21
  bgVideo = '',
21
22
  redirectTimer = 3000,
22
- logo = '../../../../../images/logo.svg',
23
+ logo = '/images/logo.svg',
23
24
  counter = false,
24
25
  isStory = false,
25
26
  operatorLogo = false,
@@ -17,7 +17,7 @@ export default function TrackerGeo({
17
17
  bgImage = '',
18
18
  bgVideo = '',
19
19
  redirectTimer = 5000,
20
- logo = '../../../../../images/logo.svg',
20
+ logo = '/images/logo.svg',
21
21
  counter = false,
22
22
  operatorLogo = false,
23
23
  operatorLogoWidth = 80,
@@ -26,17 +26,38 @@ const processImageNode = (node, moduleWidth = 960, loading) => {
26
26
  stylesClass = 'alignRight';
27
27
  }
28
28
 
29
- const imgWidth = node.attribs.width
30
- ? node.attribs.width > moduleWidth
31
- ? moduleWidth
32
- : node.attribs.width.replace('px', '')
33
- : getValueFromStyle(node?.attribs?.style, 'width') || '';
34
-
35
- const imgHeight = node.attribs.height
36
- ? node.attribs.height === 'auto'
37
- ? '298'
38
- : node.attribs.height.replace('px', '')
39
- : getValueFromStyle(node?.attribs?.style, 'height') || '';
29
+ let imgWidth
30
+
31
+ if (node.attribs.width) {
32
+ imgWidth =
33
+ node.attribs.width > moduleWidth
34
+ ? moduleWidth
35
+ : node.attribs.width.replace('px', '')
36
+ } else if (node?.attribs['data-width']) {
37
+ imgWidth =
38
+ node?.attribs['data-width'] > moduleWidth
39
+ ? moduleWidth
40
+ : node?.attribs['data-width']?.replace('px', '')
41
+ } else {
42
+ imgWidth = getValueFromStyle(node?.attribs?.style, 'width') || ''
43
+ }
44
+
45
+ let imgHeight
46
+
47
+ if (node.attribs.height) {
48
+ imgHeight =
49
+ node.attribs.height === 'auto'
50
+ ? '298'
51
+ : node.attribs.height.replace('px', '')
52
+ } else if (node.attribs['data-height']) {
53
+ imgHeight =
54
+ node.attribs['data-height'] === 'auto'
55
+ ? '298'
56
+ : node.attribs['data-height'].replace('px', '')
57
+ } else {
58
+ imgHeight = getValueFromStyle(node?.attribs?.style, 'height') || ''
59
+ }
60
+
40
61
 
41
62
  const lazyProps = {
42
63
  src: parseContentImageUrl(node.attribs.src, imgWidth, imgHeight),
@@ -44,7 +44,7 @@ export default (node, moduleWidth = 960, moduleName, pageTemplate, modulePositio
44
44
  const key = child.attribs.id || child.name
45
45
 
46
46
  if (child.name === 'img') {
47
- processImageNode(child, moduleWidth)
47
+ return processImageNode(child, moduleWidth)
48
48
  }
49
49
 
50
50
  return React.createElement(
@@ -113,7 +113,7 @@ describe('replaceMedia function', () => {
113
113
  const imageNode = transformedNode.props.children[0]
114
114
  // expect(imageNode.type).toBe(LazyImage);
115
115
  expect(imageNode.props.src).toBe(
116
- 'https://assets-srv.s3.eu-west-1.amazonaws.com/1718708348/springbok-casino-bonus.jpg'
116
+ 'https://cdn.images.com/fit-in/100x50/1718708348/springbok-casino-bonus.jpg'
117
117
  )
118
118
  expect(imageNode.props.alt).toBe('Alt text')
119
119
  expect(imageNode.props.width).toBe('100')