gatsby-core-theme 2.2.4 → 4.0.0

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/__mocks__/gatsby.js +16 -4
  3. package/gatsby-node.esm.js +14 -16
  4. package/jest.config.js +8 -1
  5. package/package.json +1 -1
  6. package/src/components/app.js +1 -17
  7. package/src/components/atoms/author/author.test.js +12 -5
  8. package/src/components/atoms/author-box/index.js +6 -5
  9. package/src/components/atoms/breadcrumbs/breadcrumbs.test.js +8 -0
  10. package/src/components/atoms/carousel/pagination-item/pagination-item.test.js +18 -3
  11. package/src/components/atoms/collapse/collapse.test.js +10 -0
  12. package/src/components/atoms/collapse/index.js +3 -1
  13. package/src/components/atoms/content-box/content-box.test.js +9 -6
  14. package/src/components/atoms/content-box/index.js +13 -12
  15. package/src/components/atoms/custom-select/index.js +31 -30
  16. package/src/components/atoms/disclaimer/disclaimer.test.js +16 -1
  17. package/src/components/atoms/iframe/iframe.module.scss +3 -0
  18. package/src/components/atoms/iframe/iframe.test.js +6 -0
  19. package/src/components/atoms/iframe/index.js +1 -1
  20. package/src/components/atoms/image/image.test.js +19 -6
  21. package/src/components/atoms/image/index.js +2 -4
  22. package/src/components/atoms/info-grid/index.js +10 -12
  23. package/src/components/atoms/label/index.js +2 -2
  24. package/src/components/atoms/label/label.test.js +4 -0
  25. package/src/components/atoms/menu/items/item/item.module.scss +4 -0
  26. package/src/components/atoms/module-title/index.js +9 -9
  27. package/src/components/atoms/module-title/module-title.test.js +76 -0
  28. package/src/components/atoms/open-graph/open-graph.test.js +34 -5
  29. package/src/components/atoms/operator-cta/operator-cta.test.js +26 -3
  30. package/src/components/atoms/scroll-to-top/scroll-to-top.test.js +6 -0
  31. package/src/components/atoms/search/autocomplete/operator.js +1 -1
  32. package/src/components/atoms/sitemap/index.js +1 -1
  33. package/src/components/atoms/spotlights/index.js +55 -53
  34. package/src/components/atoms/spotlights/spotlights.module.scss +25 -37
  35. package/src/components/atoms/spotlights/spotlights.test.js +13 -15
  36. package/src/components/molecules/content/content.test.js +127 -0
  37. package/src/components/molecules/content/index.js +2 -2
  38. package/src/components/molecules/header/header.test.js +6 -0
  39. package/src/components/molecules/main/main.test.js +48 -12
  40. package/src/components/molecules/menu/menu.test.js +27 -0
  41. package/src/components/molecules/module/module.test.js +134 -0
  42. package/src/components/molecules/operator-banner/operator-banner.test.js +7 -1
  43. package/src/components/molecules/pagination/pagination-with-midpoints.module.scss +48 -49
  44. package/src/components/organisms/anchor/index.js +1 -1
  45. package/src/components/organisms/cookie-consent/cookie-consent.test.js +7 -1
  46. package/src/components/organisms/form/form.test.js +21 -0
  47. package/src/components/organisms/form/index.js +5 -1
  48. package/src/components/organisms/navigation/index.js +9 -1
  49. package/src/components/organisms/search/index.js +0 -1
  50. package/src/components/organisms/toplist/list/index.js +1 -1
  51. package/src/components/organisms/toplist/list/list.test.js +30 -0
  52. package/src/components/pages/body/index.js +22 -5
  53. package/src/components/pages/tracker/index.js +1 -1
  54. package/src/constants/settings.js +1 -1
  55. package/src/helpers/getters.js +1 -6
  56. package/src/helpers/getters.test.js +1 -3
  57. package/src/helpers/processor/common.test.js +7 -1
  58. package/src/helpers/processor/index.js +2 -3
  59. package/src/helpers/processor/index.test.js +21 -0
  60. package/src/helpers/schema.js +30 -3
  61. package/src/helpers/schema.test.js +19 -10
  62. package/src/helpers/strings.js +10 -0
  63. package/src/helpers/strings.test.js +8 -0
  64. package/src/hooks/gatsby-img/index.js +1 -1
  65. package/src/hooks/lazy-image/index.js +1 -1
  66. package/src/hooks/lazy-image/lazy-image.test.js +39 -0
  67. package/src/hooks/lazy-picture/index.js +1 -1
  68. package/src/hooks/link/link.test.js +42 -1
  69. package/src/hooks/tabs/tab/tab.test.js +41 -0
  70. package/src/styles/utils/variables/_main.scss +3 -1
  71. package/tests/envVars.js +1 -1
  72. package/tests/factories/modules/content.factory.js +6 -3
  73. package/tests/factories/modules/modules.factory.js +152 -0
  74. package/tests/factories/modules/schema.factory.js +87 -0
  75. package/tests/factories/pages/list.factory.js +2 -1
  76. package/tests/factories/pages/pages.factory.js +192 -0
  77. package/tests/factories/sections/header.factory.js +8 -2
  78. package/src/components/atoms/logo/index.js +0 -36
  79. package/src/components/atoms/logo/logo.module.scss +0 -4
  80. package/src/components/atoms/logo/logo.stories.js +0 -57
  81. package/src/components/atoms/logo/logo.test.js +0 -30
  82. package/src/components/molecules/section/index.js +0 -24
  83. package/src/components/molecules/section/section.test.js +0 -16
  84. package/src/components/molecules/sidebar/index.js +0 -25
  85. package/src/components/molecules/sidebar/sidebar.module.scss +0 -3
  86. package/src/components/molecules/sidebar/sidebar.test.js +0 -30
@@ -0,0 +1,3 @@
1
+ .iframeContainer{
2
+ display: flex;
3
+ }
@@ -22,6 +22,12 @@ describe('Iframe Component', () => {
22
22
  expect(iframe.getAttribute('style')).toEqual('width: 100%; min-height: 10rem; display: block;');
23
23
  expect(iframe.getAttribute('src')).toEqual('http://google.com');
24
24
  });
25
+
26
+ test('without data', () => {
27
+ const { container } = render(<Iframe src="http://google.com" />);
28
+
29
+ expect(container.querySelector('iframe')).toBeFalsy();
30
+ });
25
31
  });
26
32
  afterEach(() => {
27
33
  cleanup();
@@ -26,7 +26,7 @@ const Iframe = ({
26
26
  }
27
27
 
28
28
  return (
29
- <div className={styles.iframeContainer}>
29
+ <div className={styles?.iframeContainer}>
30
30
  <iframe
31
31
  title={title}
32
32
  style={{ width: '100%', minHeight, display: 'block' }}
@@ -5,13 +5,13 @@ import '@testing-library/jest-dom/extend-expect';
5
5
  import Image from '.';
6
6
 
7
7
  describe('Image Component', () => {
8
+ const imageModule = {
9
+ alignment: 'align_right',
10
+ alt: 'image alt',
11
+ title: 'title',
12
+ value: 'image.png',
13
+ };
8
14
  test('render', () => {
9
- const imageModule = {
10
- alignment: 'align_right',
11
- alt: 'image alt',
12
- title: 'title',
13
- value: 'image.png',
14
- };
15
15
  const { container } = render(<Image module={imageModule} />);
16
16
  expect(container).toBeTruthy();
17
17
 
@@ -19,6 +19,19 @@ describe('Image Component', () => {
19
19
  // expect(container.querySelector('img')).toBeFalsy();
20
20
  // expect(container.querySelector('div.lazyload-placeholder')).toBeTruthy();
21
21
  });
22
+
23
+ test('render without data', () => {
24
+ const { container } = render(<Image />);
25
+
26
+ expect(container.querySelector('img')).toBeFalsy();
27
+ });
28
+
29
+ test('render without alt ', () => {
30
+ delete imageModule.alt;
31
+ const { container } = render(<Image module={imageModule} />);
32
+
33
+ expect(container).toBeTruthy();
34
+ });
22
35
  });
23
36
  afterEach(() => {
24
37
  cleanup();
@@ -6,19 +6,17 @@ import { imagePrettyUrl } from '~helpers/getters';
6
6
  import styles from './image.module.scss';
7
7
 
8
8
  const Image = ({ module = {} }) => {
9
- const { title, value, alt, alignment } = module;
9
+ const { title, value, alt = 'missing alt', alignment } = module;
10
10
 
11
11
  if (!value) return <></>;
12
12
 
13
13
  return (
14
- <div>
15
14
  <LazyImage
16
15
  src={imagePrettyUrl(value)}
17
- alt={alt ? alt : 'missing alt'}
16
+ alt={alt || 'missing alt'}
18
17
  title={title && title}
19
18
  className={`${styles.imageModule} ${styles[alignment]}`}
20
19
  />
21
- </div>
22
20
  );
23
21
  };
24
22
 
@@ -4,18 +4,16 @@ import PropTypes from 'prop-types';
4
4
  import styles from './info-grid.module.scss';
5
5
  import keygen from '~helpers/keygen';
6
6
 
7
- const InfoGrid = ({ data }) => {
8
- return (
9
- <div className={styles.infoGridContainer}>
10
- {data.map((row) => (
11
- <div key={keygen()} className={styles.infoGridItem}>
12
- <div className={styles.infoGridItemTitle}>{row.name}</div>
13
- <div className={styles.infoGridItemValue}>{row.value}</div>
14
- </div>
15
- ))}
16
- </div>
17
- );
18
- };
7
+ const InfoGrid = ({ data }) => (
8
+ <div className={styles.infoGridContainer}>
9
+ {data.map((row) => (
10
+ <div key={keygen()} className={styles.infoGridItem}>
11
+ <div className={styles.infoGridItemTitle}>{row.name}</div>
12
+ <div className={styles.infoGridItemValue}>{row.value}</div>
13
+ </div>
14
+ ))}
15
+ </div>
16
+ );
19
17
  InfoGrid.propTypes = {
20
18
  data: PropTypes.arrayOf(PropTypes.shape({ name: PropTypes.string, value: PropTypes.string }))
21
19
  .isRequired,
@@ -10,8 +10,8 @@ const Label = ({ title = '', bgColor = 'yellow' }) => (
10
10
  );
11
11
 
12
12
  Label.propTypes = {
13
- title: PropTypes.string.isRequired,
14
- bgColor: PropTypes.string.isRequired,
13
+ title: PropTypes.string,
14
+ bgColor: PropTypes.string,
15
15
  };
16
16
 
17
17
  export default Label;
@@ -12,6 +12,10 @@ describe('Label Component', () => {
12
12
  expect(myLabel).toBeTruthy();
13
13
  expect(myLabel.getAttribute('style')).toEqual('background-color: blue;');
14
14
  });
15
+ test('render with props', () => {
16
+ const { container } = render(<Label />);
17
+ expect(container.querySelector('span')).toBeEmptyDOMElement();
18
+ });
15
19
  });
16
20
  afterEach(() => {
17
21
  cleanup();
@@ -10,6 +10,10 @@
10
10
  .item {
11
11
  padding: 1.5rem 2rem;
12
12
 
13
+ @include custom-min-max(1200, 1260) {
14
+ padding: 1.5rem 1.8rem;
15
+ }
16
+
13
17
  &.openedLink {
14
18
  background-color: var(--primary-hover-color);
15
19
  }
@@ -14,15 +14,15 @@ const ModuleTitle = ({ module, viewMoreIcon = <FaAngleRight />, pageContext = nu
14
14
  if (module.module_title_tag === 'h6') return <h6>{module.module_title}</h6>;
15
15
  return <span className={styles.noTag}>{module.module_title}</span>;
16
16
  };
17
- if (
18
- module.name === 'content' &&
19
- (module.module_title === 'table' ||
20
- module.module_title === 'table-1' ||
21
- module.module_title === 'table-2' ||
22
- (module.style && module.style.includes('table')))
23
- ) {
24
- return null;
25
- }
17
+ // if (
18
+ // module.name === 'content' &&
19
+ // (module.module_title === 'table' ||
20
+ // module.module_title === 'table-1' ||
21
+ // module.module_title === 'table-2' ||
22
+ // (module.style && module.style.includes('table')))
23
+ // ) {
24
+ // return null;
25
+ // }
26
26
 
27
27
  const template = pageContext && pageContext?.page?.template;
28
28
 
@@ -37,6 +37,82 @@ describe('Module Title Component', () => {
37
37
  expect(getByText('View More')).toBeTruthy();
38
38
  expect(container.querySelector('a.viewMore').getAttribute('href')).toEqual('/more');
39
39
  });
40
+
41
+ test('all H elements', () => {
42
+ const arr = ['h2', 'h3', 'h4', 'h5', 'h6'];
43
+
44
+ const madeObj = (current) => {
45
+ const obj = {
46
+ module_title_tag: current,
47
+ module_title: `Title with current + ${current} `,
48
+ };
49
+ return obj;
50
+ };
51
+
52
+ const arrWithObj = arr.reduce((acc, current) => {
53
+ acc.push(madeObj(current));
54
+ return acc;
55
+ }, []);
56
+
57
+ arrWithObj.forEach((element) => {
58
+ const { container } = render(
59
+ <ModuleTitle
60
+ module={{
61
+ name: 'content',
62
+ module_title: element.module_title,
63
+ module_title_tag: element.module_title_tag,
64
+ link_label: 'View More',
65
+ link_value: '/all',
66
+ }}
67
+ />
68
+ );
69
+
70
+ expect(container.querySelector(element.module_title_tag)).toBeTruthy();
71
+ // expect(container.querySelector(element.module_title_tag)).toHaveLength(1)
72
+ });
73
+ });
74
+
75
+ test('test', () => {
76
+ const { getByText } = render(
77
+ <ModuleTitle
78
+ module={{
79
+ name: 'TestName',
80
+ module_title: 'Test',
81
+ module_title_tag: '',
82
+ link_label: 'View More',
83
+ link_value: '/all',
84
+ }}
85
+ />
86
+ );
87
+
88
+ expect(getByText('Test')).toBeTruthy();
89
+ });
90
+
91
+ test('with pageContext', () => {
92
+ const { container, getByText } = render(
93
+ <ModuleTitle
94
+ module={{
95
+ name: 'content',
96
+ module_title: 'Test Title',
97
+ module_title_tag: 'h2',
98
+ link_label: 'View More',
99
+ link_value: '/all',
100
+ style: 'Style test',
101
+ }}
102
+ pageContext={{
103
+ page: {
104
+ template: true,
105
+ },
106
+ }}
107
+ />
108
+ );
109
+
110
+ expect(getByText('Test Title')).toBeTruthy();
111
+ expect(container.querySelector('a')).toHaveAttribute('href', '/all');
112
+ expect(container.querySelectorAll('a')).toHaveLength(1);
113
+ expect(getByText('View More')).toBeTruthy();
114
+ expect(container.querySelectorAll('svg')).toHaveLength(1);
115
+ });
40
116
  });
41
117
  afterEach(() => {
42
118
  cleanup();
@@ -1,5 +1,7 @@
1
+ /* eslint-disable no-lone-blocks */
2
+ /* eslint-disable no-unused-expressions */
1
3
  import React from 'react';
2
- import { render, cleanup } from '@testing-library/react';
4
+ import { render, cleanup, fireEvent } from '@testing-library/react';
3
5
  import { getUrl } from '~helpers/getters';
4
6
  import '@testing-library/jest-dom/extend-expect';
5
7
 
@@ -11,18 +13,45 @@ describe('OpenGraph Component', () => {
11
13
  <OpenGraph
12
14
  text="test title"
13
15
  page={{
14
- title: 'test',
15
- path: '/test/path'
16
+ title: 'test',
17
+ path: '/test/path',
16
18
  }}
17
19
  />
18
20
  );
21
+ global.open = jest.fn();
19
22
 
20
- const fbURL = `https://www.facebook.com/sharer/sharer.php?caption=test&u=${getUrl('/test/path')}`;
23
+ const fbURL = `https://www.facebook.com/sharer/sharer.php?caption=test&u=${getUrl(
24
+ '/test/path'
25
+ )}`;
21
26
  const twitterURL = `https://twitter.com/intent/tweet?text=test&url=${getUrl('/test/path')}`;
22
27
 
23
28
  expect(getByText('test title')).toBeTruthy();
29
+ expect(container.querySelectorAll('svg')).toHaveLength(2);
24
30
  expect(container.querySelectorAll('a')[0]).toHaveAttribute('href', fbURL);
25
-
31
+ expect(container.querySelectorAll('a')[1]).toHaveAttribute('href', twitterURL);
32
+
33
+ const firstAhref = container.querySelectorAll('a')[0];
34
+ const secondAhref = container.querySelectorAll('a')[1];
35
+ // eslint-disable-next-line no-lone-blocks
36
+ {
37
+ firstAhref && fireEvent.click(firstAhref);
38
+ }
39
+ {
40
+ secondAhref && fireEvent.click(secondAhref);
41
+ }
42
+ expect(global.open).toBeCalled();
43
+ });
44
+
45
+ test('Render component without Title', () => {
46
+ const { getByText } = render(
47
+ <OpenGraph
48
+ page={{
49
+ title: 'test2',
50
+ path: '/test2/path',
51
+ }}
52
+ />
53
+ );
54
+ expect(getByText('Share:')).toBeTruthy();
26
55
  });
27
56
  });
28
57
  afterEach(() => {
@@ -14,9 +14,15 @@ describe('OperatorCta Component', () => {
14
14
  // });
15
15
 
16
16
  // test('test closedCasino', () => {
17
- // const { getByText } = render(<OperatorCta closedCasinoText="test2" />);
18
- // expect(getByText('test2')).toBeTruthy();
19
- // expect(container.querySelector('.closed')).toBeTruthy();
17
+ // const data = getPageData().relation;
18
+ // const obj = {
19
+ // ...data,
20
+ // status: 'closed',
21
+ // };
22
+ // const { container, getByText } = render(
23
+ // <OperatorCta closedCasinoText="test2" operator={obj} />
24
+ // );
25
+ // // expect(container.querySelector('.closed')).toBeTruthy();
20
26
  // });
21
27
 
22
28
  // test('test Active CTA', () => {
@@ -24,6 +30,12 @@ describe('OperatorCta Component', () => {
24
30
  // expect(getByText('test3')).toBeTruthy();
25
31
  // });
26
32
 
33
+ const inactiveOperator = {
34
+ bonus: { tax_free: false, min_deposit: '0', min_withdrawal: '', max_withdrawal: '' },
35
+ short_name: 'the_lotter',
36
+ status: 'inactive',
37
+ };
38
+
27
39
  test('test GTM class', () => {
28
40
  const data = getPageData();
29
41
  const { getByText } = render(
@@ -33,6 +45,17 @@ describe('OperatorCta Component', () => {
33
45
  expect(getByText('test3').closest('a').classList.contains('operator-cta-gtm')).toBe(true);
34
46
  expect(getByText('test3').closest('a').classList.contains('btn-cta')).toBe(true);
35
47
  });
48
+
49
+ test('test closed status', () => {
50
+ const { getByText } = render(
51
+ <OperatorCta
52
+ operator={inactiveOperator}
53
+ closedCasinoText="isClosedd"
54
+ placeholderText="test"
55
+ />
56
+ );
57
+ expect(getByText('isClosedd')).toBeTruthy();
58
+ });
36
59
  });
37
60
  afterEach(() => {
38
61
  cleanup();
@@ -18,6 +18,12 @@ describe('ScrollToTop Component', () => {
18
18
  fireEvent.click(btn);
19
19
  expect(scrollToSpy).toHaveBeenCalled();
20
20
  });
21
+
22
+ test('on scroll', () => {
23
+ render(<ScrollToTop scrollTo="50" />);
24
+ fireEvent.scroll(window, { target: { pageYOffset: 501 } });
25
+ fireEvent.scroll(window, { target: { pageYOffset: 301 } });
26
+ });
21
27
  });
22
28
  afterEach(() => {
23
29
  cleanup();
@@ -8,7 +8,7 @@ import styles from './operator.module.scss';
8
8
 
9
9
  const Operator = ({ item = {} }) => (
10
10
  <div className={styles.row}>
11
- <LazyImage src={imagePrettyUrl(item.relation.logo_url, null, 20)} />
11
+ <LazyImage src={imagePrettyUrl(item.relation.logo_url, null, 20)} alt={item.title} />
12
12
  <h3>{item.title}</h3>
13
13
  <Button to="/#" primaryColor isInternalLink={false} gtmClass="operator-gtm btn-cta" />
14
14
  </div>
@@ -42,7 +42,7 @@ const Sitemap = ({ pageContext, templateIcon = <BiSitemap />, linkIcon = <IoMdLi
42
42
  if (page !== undefined) {
43
43
  const pageObj = sitemapData[market][template][page];
44
44
  return (
45
- <li>
45
+ <li key={page}>
46
46
  {linkIcon && linkIcon}
47
47
  <Link to={pageObj.path} title={pageObj.title}>
48
48
  {pageObj.title}
@@ -1,3 +1,4 @@
1
+ /* eslint-disable jsx-a11y/label-has-associated-control */
1
2
  /* eslint-disable react/no-danger */
2
3
  /* eslint-disable camelcase */
3
4
  import React from 'react';
@@ -10,40 +11,41 @@ import { imagePrettyUrl } from '~helpers/getters';
10
11
  import Link from '~hooks/link';
11
12
  import styles from './spotlights.module.scss';
12
13
 
13
- const Spotlights = ({ module }) => {
14
+ const Spotlights = ({ module, themeStyles = {} }) => {
14
15
  const { show_read_more, read_more_text, items, mode } = module;
15
16
 
16
17
  const content = (item) => {
17
18
  const img = mode === 'icon' ? item.icon : item.image;
18
19
  return (
19
20
  <>
20
- <span className={styles.itemImage}>
21
- <LazyImage
22
- width={100}
23
- height={50}
24
- alt={item.label || item?.link_text}
25
- src={imagePrettyUrl(img)}
26
- />
27
- </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>
21
+ <LazyImage
22
+ width={100}
23
+ height={50}
24
+ alt={item.label || item?.link_text}
25
+ src={imagePrettyUrl(img)}
26
+ />
27
+ <label>{item.label}</label>
28
+ {item.subtitle && <span>{item.subtitle}</span>}
32
29
  </>
33
30
  );
34
31
  };
35
32
 
33
+ const getStyle = () => {
34
+ if (module.style) {
35
+ return themeStyles[module.style] || styles[module.style];
36
+ }
37
+
38
+ return ``;
39
+ };
40
+
36
41
  return (
37
- <div className={`${styles.spotlightsContainer} ${module.style ? styles[module.style] : ''}`}>
42
+ <div className={`${styles.spotlightsContainer} ${getStyle()}`}>
38
43
  {show_read_more === '1' && (
39
- <div
40
- className={styles.spotlightstext}
41
- dangerouslySetInnerHTML={{ __html: read_more_text }}
42
- />
44
+ <div className="spotlightstext" dangerouslySetInnerHTML={{ __html: read_more_text }} />
43
45
  )}
44
- <ul className={styles[mode]}>
46
+ <ul>
45
47
  {items.map((item) => (
46
- <li key={keygen()} className={styles.spotlightItem}>
48
+ <li key={keygen()}>
47
49
  {item.link.type === 'external' ? (
48
50
  <a
49
51
  href={item.link.value}
@@ -66,39 +68,37 @@ const Spotlights = ({ module }) => {
66
68
  </Link>
67
69
  )}
68
70
 
69
- {mode === 'image_text' && (
70
- <div className={styles.body}>
71
- <div className={styles.text} dangerouslySetInnerHTML={{ __html: item.text }} />
72
- {item.link.value && item.link.type === 'external' ? (
73
- <a
74
- href={item.link.value}
75
- title={item.label}
76
- target="_blank"
77
- rel="noreferrer"
78
- className={`${styles.readMore} spotlights-gtm`}
79
- >
80
- {item.link_text ? item.link_text : 'Read More'}
81
- <GrFormNextLink />
82
- </a>
83
- ) : (
84
- <>
85
- {item.link.value && (
86
- <Button
87
- btnText={item.link_text ? item.link_text : 'Read More'}
88
- invertColors
89
- className={styles.readMore}
90
- isAnchorLink
91
- isInternalLink={item.link.type !== 'external'}
92
- targetBlank={item.link.type === 'external'}
93
- to={item.link.value}
94
- primaryColor={false}
95
- gtmClass="spotlights-gtm btn-cta"
96
- />
97
- )}
98
- </>
99
- )}
100
- </div>
101
- )}
71
+ {mode === 'image_text' &&
72
+ (item.link.value ? (
73
+ <div>
74
+ <div dangerouslySetInnerHTML={{ __html: item.text }} />
75
+ {item.link.type === 'external' ? (
76
+ <a
77
+ href={item.link.value}
78
+ title={item.label}
79
+ target="_blank"
80
+ rel="noreferrer"
81
+ className="spotlights-gtm"
82
+ >
83
+ {item.link_text ? item.link_text : 'Read More'}
84
+ <GrFormNextLink />
85
+ </a>
86
+ ) : (
87
+ <Button
88
+ btnText={item.link_text ? item.link_text : 'Read More'}
89
+ invertColors
90
+ isAnchorLink
91
+ isInternalLink={item.link.type !== 'external'}
92
+ targetBlank={item.link.type === 'external'}
93
+ to={item.link.value}
94
+ primaryColor={false}
95
+ gtmClass="spotlights-gtm btn-cta"
96
+ />
97
+ )}
98
+ </div>
99
+ ) : (
100
+ <div dangerouslySetInnerHTML={{ __html: item.text }} />
101
+ ))}
102
102
  </li>
103
103
  ))}
104
104
  </ul>
@@ -106,6 +106,8 @@ const Spotlights = ({ module }) => {
106
106
  );
107
107
  };
108
108
  Spotlights.propTypes = {
109
+ // eslint-disable-next-line react/forbid-prop-types
110
+ themeStyles: PropTypes.object,
109
111
  module: PropTypes.shape({
110
112
  style: PropTypes.string,
111
113
  mode: PropTypes.oneOf(['image', 'icon', 'image_text']).isRequired,
@@ -2,6 +2,7 @@
2
2
  margin: 0 auto;
3
3
  width: 100%;
4
4
  max-width: var(--main-container-max);
5
+
5
6
  ul {
6
7
  display: grid;
7
8
  grid-template-columns: repeat(1, 1fr);
@@ -15,58 +16,45 @@
15
16
  column-gap: 1.6rem;
16
17
  }
17
18
  li {
18
- background-color: white;
19
- border: 1px solid #eee;
19
+ text-align: center;
20
+ background-color: var(--color-9);
21
+ border: none;
20
22
  margin-bottom: 1rem;
23
+ padding: 1.5rem;
24
+
21
25
  @include min(desktop) {
22
26
  margin-bottom: 1.6rem;
23
27
  }
28
+
24
29
  @include flex-direction(column);
25
- span {
26
- display: block;
27
- }
28
- .itemImage {
29
- width: 100%;
30
- height: 15rem;
31
- img {
32
- width: auto;
33
- height: 100%;
34
- object-fit: cover;
35
- }
30
+
31
+ img {
32
+ margin: 0 auto;
36
33
  }
37
34
 
38
- .content {
39
- padding: 1rem;
40
- .label {
41
- font-weight: 700;
42
- font-size: 2rem;
43
- color: black;
35
+ > a {
36
+ @include flex-direction(column);
37
+ color: #000;
38
+ font-size: 2rem;
39
+ font-weight: 700;
40
+
41
+ label {
42
+ cursor: pointer;
44
43
  }
45
44
  }
46
45
 
47
- .body {
48
- padding: 0 1rem 1rem 1rem;
46
+ span {
47
+ display: block;
49
48
  }
50
- .text {
49
+
50
+ > div {
51
51
  font-size: 1.4rem;
52
52
  color: #777;
53
53
  }
54
- .readMore {
55
- color: blue;
56
- font-size: 1.4rem;
57
- @include flex-direction(row);
58
- @include flex-align(center, flex-end);
59
- margin: 1rem 0 0 0;
60
- svg * {
61
- color: blue;
62
- stroke: blue;
63
- }
54
+
55
+ svg {
56
+ display: none;
64
57
  }
65
58
  }
66
59
  }
67
60
  }
68
- .spotlightstext {
69
- width: 100%;
70
- margin: 2rem 0;
71
- font-size: 1.6rem;
72
- }