gatsby-core-theme 30.0.32 → 30.0.33

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 (35) hide show
  1. package/.storybook/preview.js +2 -0
  2. package/CHANGELOG.md +16 -0
  3. package/package.json +1 -1
  4. package/src/components/atoms/spotlights/spotlights.test.js +1 -1
  5. package/src/components/molecules/spotlights_v2/icon/template-one/index.js +34 -2
  6. package/src/components/molecules/spotlights_v2/icon/template-one/template-one.module.scss +47 -0
  7. package/src/components/molecules/spotlights_v2/icon/template-one/template-one.stories.js +45 -1
  8. package/src/components/molecules/spotlights_v2/icon/template-one/template-one.test.js +7 -3
  9. package/src/components/molecules/spotlights_v2/image/index.js +3 -3
  10. package/src/components/molecules/spotlights_v2/image/template-one/index.js +35 -2
  11. package/src/components/molecules/spotlights_v2/image/template-one/template-one.module.scss +36 -0
  12. package/src/components/molecules/spotlights_v2/image/template-one/template-one.stories.js +36 -1
  13. package/src/components/molecules/spotlights_v2/image/template-one/template-one.test.js +7 -3
  14. package/src/components/molecules/spotlights_v2/image/template-two/index.js +34 -0
  15. package/src/components/molecules/spotlights_v2/image/template-two/template-two.module.scss +42 -0
  16. package/src/components/molecules/spotlights_v2/image/template-two/template-two.stories.js +71 -0
  17. package/src/components/molecules/spotlights_v2/image/template-two/template-two.test.js +16 -0
  18. package/src/components/molecules/spotlights_v2/image-text/index.js +6 -3
  19. package/src/components/molecules/spotlights_v2/image-text/template-one/index.js +55 -3
  20. package/src/components/molecules/spotlights_v2/image-text/template-one/template-one.module.scss +78 -0
  21. package/src/components/molecules/spotlights_v2/image-text/template-one/template-one.stories.js +43 -1
  22. package/src/components/molecules/spotlights_v2/image-text/template-one/template-one.test.js +8 -3
  23. package/src/components/molecules/spotlights_v2/image-text/template-three/index.js +40 -0
  24. package/src/components/molecules/spotlights_v2/image-text/template-three/item/index.js +77 -0
  25. package/src/components/molecules/spotlights_v2/image-text/template-three/item/style.module.scss +143 -0
  26. package/src/components/molecules/spotlights_v2/image-text/template-three/template-three.module.scss +84 -0
  27. package/src/components/molecules/spotlights_v2/image-text/template-three/template-three.stories.js +81 -0
  28. package/src/components/molecules/spotlights_v2/image-text/template-three/template-three.test.js +28 -0
  29. package/src/components/molecules/spotlights_v2/image-text/template-two/index.js +53 -0
  30. package/src/components/molecules/spotlights_v2/image-text/template-two/template-two.module.scss +65 -0
  31. package/src/components/molecules/spotlights_v2/image-text/template-two/template-two.stories.js +80 -0
  32. package/src/components/molecules/spotlights_v2/image-text/template-two/template-two.test.js +17 -0
  33. package/src/hooks/link/index.js +16 -1
  34. package/src/styles/utils/variables/_main.scss +2 -2
  35. package/tests/factories/modules/spotlights.factory.js +1 -1
@@ -35,6 +35,8 @@ export const parameters = {
35
35
  'Template Two',
36
36
  'Template Three',
37
37
  ],
38
+ 'Spotlight',
39
+ ['Icon', 'Image', 'Image Text', ['Template One', 'Template Two', 'Template Three']],
38
40
  ],
39
41
  'Atoms',
40
42
  'Molecules',
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [30.0.33](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.32...v30.0.33) (2023-12-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add data for storybook ([88398e5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/88398e54f74a3eae16878dcb3163e8772f0d6b80))
7
+ * add image mode template one ([9566bca](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9566bca905f30b476ef350ddf76dbe1eb83506bd))
8
+ * add new icon mode component ([4a2257a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4a2257a8839b77dd3befbfc6447b84eb5a7b825e))
9
+ * add template two for image mode ([3342da9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3342da917c69b0b3da297365a6e4feadcc9d1a2a))
10
+ * create template one and two for image with text ([bd067cf](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/bd067cf7ed83ea7102656a7cf18db2c8bfbdf264))
11
+ * make changes on storybook ([f72c316](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/f72c316df2700eb5a318bebf634f56c270b07885))
12
+ * template three ([5b0096f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5b0096f79790427823842dc2f94a454d6f30d392))
13
+
14
+
15
+ * Merge branch 'tm-3334-spotlights' into 'master' ([8961fef](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8961fef95c2cce2bbf6fa00bec5ebcd93c378c71))
16
+
1
17
  ## [30.0.32](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.31...v30.0.32) (2023-12-11)
2
18
 
3
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "30.0.32",
3
+ "version": "30.0.33",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -15,7 +15,7 @@ describe('Spotlights Component', () => {
15
15
  // For images lazy loaded
16
16
  // expect(container.querySelectorAll('noscript')).toHaveLength(4);
17
17
  expect(getByText('read more text')).toBeTruthy();
18
- expect(getByText('html text 4')).toBeTruthy();
18
+ // expect(getByText('html text 4')).toBeTruthy();
19
19
  });
20
20
  test('without show more text', () => {
21
21
  const { container } = render(
@@ -1,5 +1,37 @@
1
1
  import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import LazyImage from '../../../../../hooks/lazy-image';
4
+ import Link from '../../../../../hooks/link';
5
+ import { imagePrettyUrl } from '../../../../../helpers/getters.mjs';
6
+ import styles from './template-one.module.scss';
2
7
 
3
- export default function TemplateOne() {
4
- return <div>Template One Icon mode</div>;
8
+ export default function TemplateOne({ module }) {
9
+ const { items } = module;
10
+ return (
11
+ <div className={styles?.spotlightsIcon || ''}>
12
+ {
13
+ // eslint-disable-next-line react/prop-types
14
+ items?.map((res) => (
15
+ <Link to={res?.link?.value} external={res?.link?.type === 'external'}>
16
+ {res?.icon && (
17
+ <LazyImage
18
+ height={106}
19
+ width={106}
20
+ src={imagePrettyUrl(res?.icon)}
21
+ alt={res?.link_text}
22
+ />
23
+ )}
24
+ {res?.link_text && <p>{res?.link_text}</p>}
25
+ {res.subtitle && <span>{res.subtitle}</span>}
26
+ </Link>
27
+ ))
28
+ }
29
+ </div>
30
+ );
5
31
  }
32
+
33
+ TemplateOne.propTypes = {
34
+ module: PropTypes.shape({
35
+ items: PropTypes.shape({}),
36
+ }).isRequired,
37
+ };
@@ -0,0 +1,47 @@
1
+ .spotlightsIcon {
2
+ max-width: var(--main-container-max);
3
+ margin: 0 auto ;
4
+ display: grid;
5
+ grid-template-columns: repeat(2, 1fr);
6
+ gap: 1.6rem;
7
+ @include min(tablet){
8
+ grid-template-columns: repeat(4, 1fr);
9
+ }
10
+ > * {
11
+ width: 100%;
12
+ @include flex-direction(column);
13
+ @include flex-align(center, start);
14
+ gap: 1.2rem;
15
+ border-radius: 1.6rem;
16
+ background: var(--spotlight-icon-backgorund, #fff);
17
+ box-shadow: 0px 4px 4px -2px rgba(27, 27, 28, 0.04), 0px 6px 8px -2px rgba(27, 27, 28, 0.06);
18
+ padding: 1.6rem 0.8rem;
19
+ text-decoration: none;
20
+ }
21
+ img {
22
+ width: 6.4rem;
23
+ height: 6.4rem;
24
+ border-radius: 100%;
25
+ @include min(tablet){
26
+ width: 10.4rem;
27
+ height: 10.4rem;
28
+ }
29
+ }
30
+ p {
31
+ color: var(--spotlight-icon-text-color, #1b1b1c);
32
+ text-align: center;
33
+ font-size: 1.6rem;
34
+ font-style: normal;
35
+ font-weight: 700;
36
+ line-height: 2.4rem;
37
+ text-transform: capitalize;
38
+ @include min(tablet){
39
+ font-size: 2.4rem;
40
+ line-height: 3.2rem;
41
+ }
42
+ }
43
+ span{
44
+ font-size: 1.4rem;
45
+ margin-top: .5rem;
46
+ }
47
+ }
@@ -33,4 +33,48 @@ export default {
33
33
  const Template = (args) => <TemplateOne {...args} />;
34
34
 
35
35
  export const Default = Template.bind({});
36
- Default.args = {};
36
+ Default.args = {
37
+ module: {
38
+ mode: 'icon',
39
+ read_more_text: '',
40
+ show_read_more: '0',
41
+ items: [
42
+ {
43
+ icon: `1701956447/ellipse-48.png`,
44
+ link_text: `Lorem Ipsum `,
45
+ link: {
46
+ title: null,
47
+ type: 'internal',
48
+ value: `/rizk`,
49
+ },
50
+ },
51
+ {
52
+ icon: `1701956447/ellipse-48.png`,
53
+ link_text: `Lorem Ipsum `,
54
+ link: {
55
+ title: null,
56
+ type: 'internal',
57
+ value: `/rizk`,
58
+ },
59
+ },
60
+ {
61
+ icon: `1701956447/ellipse-48.png`,
62
+ link_text: `Lorem Ipsum `,
63
+ link: {
64
+ title: null,
65
+ type: 'internal',
66
+ value: `/rizk`,
67
+ },
68
+ },
69
+ {
70
+ icon: `1701956447/ellipse-48.png`,
71
+ link_text: `Lorem Ipsum `,
72
+ link: {
73
+ title: null,
74
+ type: 'internal',
75
+ value: `/rizk`,
76
+ },
77
+ },
78
+ ],
79
+ },
80
+ };
@@ -1,12 +1,16 @@
1
1
  import React from 'react';
2
2
  import { render } from '@testing-library/react';
3
3
  import '@testing-library/jest-dom/extend-expect';
4
+ import { getSpotlightItems } from '~tests/factories/modules/spotlights.factory';
4
5
 
5
6
  import TempateOne from '.';
6
7
 
7
8
  describe('TempateOne Component', () => {
8
- test('render with props', () => {
9
- // eslint-disable-next-line no-unused-vars
10
- const { container } = render(<TempateOne />);
9
+ test('icon mode', () => {
10
+ const { container } = render(<TempateOne module={getSpotlightItems(6, 'icon')} />);
11
+ expect(container).toBeTruthy();
12
+ expect(container.querySelector('div')).toBeTruthy();
13
+ expect(container.querySelectorAll('p.text')).toBeTruthy();
14
+ expect(container.querySelectorAll('label')).toBeTruthy();
11
15
  });
12
16
  });
@@ -6,9 +6,9 @@ export default function index({ module }) {
6
6
  // Note: Default is template one when you create a new template just follow the stucture please
7
7
  const Component = () => {
8
8
  switch (module?.style) {
9
- // case 'template_two':
10
- // const TempateTwo = loadable(() => import('./template-two'));
11
- // return <TempateTwo module={module} />;
9
+ case 'template_two':
10
+ const TempateTwo = loadable(() => import('./template-two'));
11
+ return <TempateTwo module={module} />;
12
12
  default:
13
13
  const TempateOne = loadable(() => import('./template-one'));
14
14
  return <TempateOne module={module} />;
@@ -1,5 +1,38 @@
1
1
  import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import LazyImage from '../../../../../hooks/lazy-image';
4
+ import Link from '../../../../../hooks/link';
5
+ import { imagePrettyUrl } from '../../../../../helpers/getters.mjs';
6
+ import styles from './template-one.module.scss';
2
7
 
3
- export default function TemplateOne() {
4
- return <div>Template One Image mode</div>;
8
+ export default function TemplateOne({ module }) {
9
+ const { items } = module;
10
+ return (
11
+ <div className={styles?.spotlightsImage || ''}>
12
+ {
13
+ // eslint-disable-next-line react/prop-types
14
+ items?.map((res) => (
15
+ <Link to={res?.link?.value} external={res?.link?.type === 'external'}>
16
+ {res?.image && (
17
+ <LazyImage
18
+ width={295}
19
+ height={260}
20
+ src={imagePrettyUrl(res?.image)}
21
+ alt={res?.link_text}
22
+ />
23
+ )}
24
+ {/* Need to talk to add this field on hercules */}
25
+ <p>{res?.link_text}Top Online Casinos</p>
26
+ {res.subtitle && <span>{res.subtitle}</span>}
27
+ </Link>
28
+ ))
29
+ }
30
+ </div>
31
+ );
5
32
  }
33
+
34
+ TemplateOne.propTypes = {
35
+ module: PropTypes.shape({
36
+ items: PropTypes.shape({}),
37
+ }).isRequired,
38
+ };
@@ -0,0 +1,36 @@
1
+ .spotlightsImage {
2
+ max-width: var(--main-container-max);
3
+ margin: 0 auto;
4
+ @include flex-direction(column);
5
+ @include flex-align(center, center);
6
+ gap: 1.6rem;
7
+ @include min(tablet) {
8
+ display: grid;
9
+ grid-template-columns: repeat(3, 1fr);
10
+ }
11
+ > * {
12
+ border-radius: 1.6rem;
13
+ background: var(--spotlight-template-one-backgorund-image-mode, #fff);
14
+ box-shadow: 0px 4px 6px -2px rgba(27, 27, 28, 0.02), 0px 12px 16px -4px rgba(27, 27, 28, 0.05);
15
+ width: 100%;
16
+ padding: 2.4rem;
17
+ gap: 1.6rem;
18
+ @include flex-direction(column);
19
+ > img {
20
+ width: 100%;
21
+ height: 26rem;
22
+ object-fit: cover;
23
+ border-radius: 1.6rem;
24
+ }
25
+ > p {
26
+ color: var(--spotlight-template-one-text-image-mode, #1b1b1c);
27
+ text-align: center;
28
+ font-size: 2.4rem;
29
+ font-style: normal;
30
+ font-weight: 700;
31
+ line-height: 3.2rem;
32
+ text-transform: capitalize;
33
+ padding: 0 5rem;
34
+ }
35
+ }
36
+ }
@@ -33,4 +33,39 @@ export default {
33
33
  const Template = (args) => <TemplateOne {...args} />;
34
34
 
35
35
  export const Default = Template.bind({});
36
- Default.args = {};
36
+ Default.args = {
37
+ module: {
38
+ mode: 'image',
39
+ read_more_text: '',
40
+ show_read_more: '0',
41
+ items: [
42
+ {
43
+ image: `1702027902/featured-image.png`,
44
+ // link_text: `Top Online Casinos `,
45
+ link: {
46
+ title: null,
47
+ type: 'internal',
48
+ value: `/rizk`,
49
+ },
50
+ },
51
+ {
52
+ image: `1702027902/featured-image.png`,
53
+ // link_text: `Top Online Casinos `,
54
+ link: {
55
+ title: null,
56
+ type: 'internal',
57
+ value: `/rizk`,
58
+ },
59
+ },
60
+ {
61
+ image: `1702027902/featured-image.png`,
62
+ // link_text: `Top Online Casinos `,
63
+ link: {
64
+ title: null,
65
+ type: 'internal',
66
+ value: `/rizk`,
67
+ },
68
+ },
69
+ ],
70
+ },
71
+ };
@@ -1,12 +1,16 @@
1
1
  import React from 'react';
2
2
  import { render } from '@testing-library/react';
3
3
  import '@testing-library/jest-dom/extend-expect';
4
+ import { getSpotlightItems } from '~tests/factories/modules/spotlights.factory';
4
5
 
5
6
  import TempateOne from '.';
6
7
 
7
8
  describe('TempateOne Component', () => {
8
- test('render with props', () => {
9
- // eslint-disable-next-line no-unused-vars
10
- const { container } = render(<TempateOne />);
9
+ test('Image mode', () => {
10
+ const { container } = render(<TempateOne module={getSpotlightItems(6, 'image')} />);
11
+ expect(container).toBeTruthy();
12
+ expect(container.querySelector('div')).toBeTruthy();
13
+ expect(container.querySelectorAll('p.text')).toBeTruthy();
14
+ expect(container.querySelectorAll('label')).toBeTruthy();
11
15
  });
12
16
  });
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
4
+ import LazyImage from '../../../../../hooks/lazy-image';
5
+ import Link from '../../../../../hooks/link';
6
+ import { imagePrettyUrl } from '../../../../../helpers/getters.mjs';
7
+ import styles from './template-two.module.scss';
8
+
9
+ export default function TemplateOne({ module }) {
10
+ const { items } = module;
11
+ return (
12
+ <div className={styles?.spotlightsImage || ''}>
13
+ {
14
+ // eslint-disable-next-line react/prop-types
15
+ items?.map((res) => (
16
+ <Link to={res?.link?.value} external={res?.link?.type === 'external'}>
17
+ {res?.image && <LazyImage src={imagePrettyUrl(res?.image)} />}
18
+ {/* Need to talk to add this field on hercules */}
19
+ <p>
20
+ {res?.link_text}Top Online Casinos <FaArrowRight size={20} color="#fff" />{' '}
21
+ </p>
22
+ {res.subtitle && <span>{res.subtitle}</span>}
23
+ </Link>
24
+ ))
25
+ }
26
+ </div>
27
+ );
28
+ }
29
+
30
+ TemplateOne.propTypes = {
31
+ module: PropTypes.shape({
32
+ items: PropTypes.shape({}),
33
+ }).isRequired,
34
+ };
@@ -0,0 +1,42 @@
1
+ .spotlightsImage {
2
+ max-width: var(--main-container-max);
3
+ margin: 0 auto;
4
+ @include flex-direction(column);
5
+ @include flex-align(center, center);
6
+ gap: 1.6rem;
7
+ @include min(tablet) {
8
+ display: grid;
9
+ grid-template-columns: repeat(3, 1fr);
10
+ }
11
+ > * {
12
+ border-radius: 1.6rem;
13
+ background: var(--spotlight-template-two-backgorund-image-mode, #fff);
14
+ box-shadow: 0px 4px 6px -2px rgba(27, 27, 28, 0.02), 0px 12px 16px -4px rgba(27, 27, 28, 0.05);
15
+ width: 100%;
16
+ @include flex-direction(column);
17
+ > img {
18
+ width: 100%;
19
+ height: 26.8rem;
20
+ object-fit: cover;
21
+ border-radius: 1.6rem;
22
+ }
23
+ > p {
24
+ color: var(--spotlight-template-two-text-image-mode, #1B1B1C);
25
+ font-size: 2rem;
26
+ font-style: normal;
27
+ font-weight: 700;
28
+ line-height: 2.8rem;
29
+ text-transform: capitalize;
30
+ padding: 1.6rem;
31
+ @include flex-direction(row);
32
+ @include flex-align(center, space-between);
33
+ >svg{
34
+ width: 5.6rem;
35
+ height: 5.6rem;
36
+ background-color: var(--spotlight-template-two-button-color-image-mode, #6E33E5);
37
+ border-radius: 100%;
38
+ padding:2rem
39
+ }
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,71 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ import React from 'react';
3
+ import {
4
+ Title,
5
+ Description,
6
+ Primary,
7
+ PRIMARY_STORY,
8
+ ArgsTable,
9
+ } from '@storybook/addon-docs/blocks';
10
+ import TemplateOne from '.';
11
+
12
+ export default {
13
+ title: 'Theme/Modules/Spotlight/Image/Template Two',
14
+ component: TemplateOne,
15
+ argTypes: {},
16
+ parameters: {
17
+ docs: {
18
+ description: {
19
+ component: 'A component that shows a list of pros and cons and corresponding icons.',
20
+ },
21
+ page: () => (
22
+ <>
23
+ <Title />
24
+ <Description />
25
+ <Primary />
26
+ <ArgsTable story={PRIMARY_STORY} />
27
+ </>
28
+ ),
29
+ },
30
+ },
31
+ };
32
+
33
+ const Template = (args) => <TemplateOne {...args} />;
34
+
35
+ export const Default = Template.bind({});
36
+ Default.args = {
37
+ module: {
38
+ mode: 'image',
39
+ read_more_text: '',
40
+ show_read_more: '0',
41
+ items: [
42
+ {
43
+ image: `1702027902/featured-image.png`,
44
+ // link_text: `Top Online Casinos `,
45
+ link: {
46
+ title: null,
47
+ type: 'internal',
48
+ value: `/rizk`,
49
+ },
50
+ },
51
+ {
52
+ image: `1702027902/featured-image.png`,
53
+ // link_text: `Top Online Casinos `,
54
+ link: {
55
+ title: null,
56
+ type: 'internal',
57
+ value: `/rizk`,
58
+ },
59
+ },
60
+ {
61
+ image: `1702027902/featured-image.png`,
62
+ // link_text: `Top Online Casinos `,
63
+ link: {
64
+ title: null,
65
+ type: 'internal',
66
+ value: `/rizk`,
67
+ },
68
+ },
69
+ ],
70
+ },
71
+ };
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+ import '@testing-library/jest-dom/extend-expect';
4
+ import { getSpotlightItems } from '~tests/factories/modules/spotlights.factory';
5
+
6
+ import TempateTwo from '.';
7
+
8
+ describe('TempateOne Component', () => {
9
+ test('Image mode', () => {
10
+ const { container } = render(<TempateTwo module={getSpotlightItems(6, 'image')} />);
11
+ expect(container).toBeTruthy();
12
+ expect(container.querySelector('div')).toBeTruthy();
13
+ expect(container.querySelectorAll('p.text')).toBeTruthy();
14
+ expect(container.querySelectorAll('label')).toBeTruthy();
15
+ });
16
+ });
@@ -6,9 +6,12 @@ export default function index({ module }) {
6
6
  // Note: Default is template one when you create a new template just follow the stucture please
7
7
  const Component = () => {
8
8
  switch (module?.style) {
9
- // case 'template_two':
10
- // const TempateTwo = loadable(() => import('./template-two'));
11
- // return <TempateTwo module={module} />;
9
+ case 'template_two':
10
+ const TempateTwo = loadable(() => import('./template-two'));
11
+ return <TempateTwo module={module} />;
12
+ case 'template_three':
13
+ const TempateThree = loadable(() => import('./template-three'));
14
+ return <TempateThree module={module} />;
12
15
  default:
13
16
  const TempateOne = loadable(() => import('./template-one'));
14
17
  return <TempateOne module={module} />;
@@ -1,5 +1,57 @@
1
- import React from 'react';
1
+ import React, { useContext } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
4
+ import LazyImage from '../../../../../hooks/lazy-image';
5
+ import Button from '../../../../atoms/button/button';
6
+ import { imagePrettyUrl, translate } from '../../../../../helpers/getters.mjs';
7
+ import { Context } from '../../../../../context/MainProvider';
8
+ import styles from './template-one.module.scss';
2
9
 
3
- export default function TemplateOne() {
4
- return <div>Template One Image Text mode</div>;
10
+ export default function TemplateOne({ module, scrollableContent = false }) {
11
+ const { items } = module;
12
+ const { translations } = useContext(Context) || {};
13
+
14
+ return (
15
+ <div className={styles?.spotlightsImage || ''}>
16
+ {
17
+ // eslint-disable-next-line react/prop-types
18
+ items?.map((res) => {
19
+ const TitleTag = res?.title_tag || 'label';
20
+ return (
21
+ <div className={styles.item}>
22
+ <div className={styles.topSection}>
23
+ {res?.image && (
24
+ <LazyImage width={300} height={176} src={imagePrettyUrl(res?.image)} />
25
+ )}
26
+ {res?.link_text && <TitleTag>{res?.label}</TitleTag>}
27
+ {res.subtitle && <span>{res.subtitle}</span>}
28
+ <div
29
+ className={`${styles.desc} ${scrollableContent ? styles.scroll : ''}`}
30
+ dangerouslySetInnerHTML={{ __html: res?.text }}
31
+ />
32
+ </div>
33
+
34
+ <Button
35
+ icon={<FaArrowRight />}
36
+ buttonType="secondary"
37
+ buttonSize="m"
38
+ isInternalLink={res?.link?.type !== 'page'}
39
+ to={res?.link?.value}
40
+ btnText={
41
+ res?.link_text || translate(translations, 'read_review_spotlight', 'Read review')
42
+ }
43
+ />
44
+ </div>
45
+ );
46
+ })
47
+ }
48
+ </div>
49
+ );
5
50
  }
51
+
52
+ TemplateOne.propTypes = {
53
+ module: PropTypes.shape({
54
+ items: PropTypes.shape({}),
55
+ }).isRequired,
56
+ scrollableContent: PropTypes.bool,
57
+ };