gatsby-matrix-theme 17.1.0 → 17.1.2

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 (48) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/package.json +2 -2
  3. package/src/components/atoms/cards/author/template-one/index.js +56 -0
  4. package/src/components/atoms/cards/author/template-one/template-one.module.scss +77 -0
  5. package/src/components/atoms/cards/author/template-one/template-one.stories.js +42 -0
  6. package/src/components/atoms/cards/author/template-one/template-one.test.js +29 -0
  7. package/src/components/atoms/cards/author/template-two/index.js +51 -0
  8. package/src/components/atoms/cards/author/template-two/template-two.module.scss +70 -0
  9. package/src/components/atoms/cards/author/template-two/template-two.stories.js +42 -0
  10. package/src/components/atoms/cards/author/template-two/template-two.test.js +27 -0
  11. package/src/components/atoms/cards/comparison-table/index.js +2 -1
  12. package/src/components/atoms/cards/{payment-method-card → payment-method}/template-one/index.js +8 -3
  13. package/src/components/atoms/cards/{payment-method-card → payment-method}/template-three/index.js +8 -3
  14. package/src/components/molecules/header/variants/author/template-four/index.js +1 -1
  15. package/src/components/molecules/header/variants/author/template-one/index.js +2 -1
  16. package/src/components/molecules/header/variants/author/template-three/index.js +1 -1
  17. package/src/components/molecules/header/variants/author/template-two/index.js +1 -1
  18. package/src/components/molecules/operator-summary/index.js +3 -1
  19. package/src/gatsby-core-theme/components/atoms/module-title/index.js +1 -1
  20. package/src/gatsby-core-theme/components/molecules/header/header.test.js +1 -1
  21. package/src/gatsby-core-theme/components/molecules/header/index.js +3 -4
  22. package/src/gatsby-core-theme/components/molecules/main/index.js +2 -2
  23. package/src/gatsby-core-theme/components/molecules/module/index.js +1 -1
  24. package/src/gatsby-core-theme/components/organisms/cards/index.js +17 -6
  25. package/src/gatsby-core-theme/components/organisms/head/index.js +2 -2
  26. package/src/gatsby-core-theme/components/pages/body/index.js +6 -5
  27. package/src/gatsby-core-theme/helpers/schema.js +2 -1
  28. package/storybook/public/{870.09305416.iframe.bundle.js → 870.4fcc5488.iframe.bundle.js} +3 -3
  29. package/storybook/public/{870.09305416.iframe.bundle.js.map → 870.4fcc5488.iframe.bundle.js.map} +1 -1
  30. package/storybook/public/iframe.html +1 -1
  31. package/storybook/public/main.8c312a18.iframe.bundle.js +1 -0
  32. package/tests/factories/authors/author.factory.js +1 -0
  33. package/tests/factories/pages/default.factory.js +1 -1
  34. package/storybook/public/main.b885f939.iframe.bundle.js +0 -1
  35. /package/src/components/{molecules/header/variants/author/assets → atoms/author}/socials/index.js +0 -0
  36. /package/src/components/{molecules/header/variants/author/assets → atoms/author}/socials/socials.module.scss +0 -0
  37. /package/src/components/atoms/cards/{payment-method-card → payment-method}/sellingPoints/index.js +0 -0
  38. /package/src/components/atoms/cards/{payment-method-card → payment-method}/sellingPoints/selling-points.module.scss +0 -0
  39. /package/src/components/atoms/cards/{payment-method-card → payment-method}/sellingPoints/selling-points.test.js +0 -0
  40. /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-one/template-one.module.scss +0 -0
  41. /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-one/template-one.stories.js +0 -0
  42. /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-one/template-one.test.js +0 -0
  43. /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-three/template-three.module.scss +0 -0
  44. /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-three/template-three.stories.js +0 -0
  45. /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-three/template-three.test.js +0 -0
  46. /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-two/index.js +0 -0
  47. /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-two/template-two.stories.js +0 -0
  48. /package/storybook/public/{870.09305416.iframe.bundle.js.LICENSE.txt → 870.4fcc5488.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ ## [17.1.2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v17.1.1...v17.1.2) (2023-03-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * author card template styling ([9df14a4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9df14a4410259e19be59a9017b0754ddd7a791b5))
7
+ * payment method ([756586e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/756586eaf0f234efdf85ffafefcd49c70cefad38))
8
+ * payment method ([5808dd9](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5808dd9fba19c6019d700200270333841708e01b))
9
+
10
+ ## [17.1.1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v17.1.0...v17.1.1) (2023-03-29)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * added author card templates ([a8d4a45](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a8d4a451f3f4dc9a88ae9d25ff06ac92c52b4bd3))
16
+ * added author cards ([4ec39da](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4ec39dad041fdcab2baf0228019dfe1783533bec))
17
+ * change page type to relation_type ([b535e0f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b535e0fda43ef5396d340562e20cf506fb3ee708))
18
+ * conflict ([4a1f6b4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4a1f6b45b3a345dff627f7d9c265c88515389e22))
19
+ * remove console.log and update if else ([cc3c224](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/cc3c2242bd7703c3cd4c0c979b6458edae9bb8c6))
20
+ * update core version ([e516ad6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e516ad696b1422289d6e5d3a17c23d0a78bf73d3))
21
+ * update to the latest core version ([484a4de](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/484a4defd5886e569bbdcfc58ed89442990d7e27))
22
+ * update with the latest change ([71a9d0b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/71a9d0b0a1181009c3a6e7fa0dc25405b889f252))
23
+
24
+
25
+ * Merge branch 'tm-3312-author-cards' into 'master' ([3a436d0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/3a436d0f817f04593539cf9edd79ce398b7fa7fd))
26
+ * Merge branch 'tm-3088-have-you-found-feature' into 'master' ([ecbc01b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ecbc01bf80e3f5be63c679557fbe6941757d9676))
27
+ * Merge branch 'tm-3324-change-type' into 'master' ([ed96781](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ed96781f772b083fac0509a4fd704e3f21464404))
28
+ * Merge branch 'master' into tm-3312-author-cards ([a7dccdf](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a7dccdfb44b2311142e0c171c4855e27e60187e5))
29
+
1
30
  # [17.1.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v17.0.1...v17.1.0) (2023-03-29)
2
31
 
3
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "17.1.0",
3
+ "version": "17.1.2",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@react-icons/all-files": "^4.1.0",
27
27
  "gatsby": "^4.20.0",
28
- "gatsby-core-theme": "18.0.27",
28
+ "gatsby-core-theme": "18.0.28",
29
29
  "gatsby-plugin-sharp": "^4.10.2",
30
30
  "gatsby-plugin-sitemap": "^3.3.0",
31
31
  "gatsby-transformer-sharp": "^4.10.0",
@@ -0,0 +1,56 @@
1
+ import React, { useContext } from 'react';
2
+ import { Context } from 'gatsby-core-theme/src/context/MainProvider';
3
+ import Link from 'gatsby-core-theme/src/hooks/link';
4
+ import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
5
+ import PropTypes from 'prop-types';
6
+ import LazyImage from '~hooks/lazy-image';
7
+ import Socials from '../../../author/socials';
8
+ import styles from './template-one.module.scss';
9
+ import { imagePrettyUrl, getAltText, translate, textWordsLimit } from '~helpers/getters';
10
+
11
+ export default function TemplateOne({ item }) {
12
+ const author = item.relation;
13
+ const { translations } = useContext(Context);
14
+
15
+ return (
16
+ <div className={styles.container}>
17
+ <span className={styles.posts}>
18
+ {author.pages_count} {translate(translations, 'posts', 'Posts')}
19
+ </span>
20
+ <LazyImage
21
+ src={imagePrettyUrl(author.image_object.filename, 72, 72)}
22
+ alt={getAltText(author.image_object, author.image_alt || author.name)}
23
+ width={72}
24
+ height={72}
25
+ />
26
+ <span className={styles.title}>{author.author_title}</span>
27
+ <span className={styles.name}>{author.name}</span>
28
+ <Socials className={styles.socials} author={author} />
29
+ <div
30
+ className={styles.bio}
31
+ // eslint-disable-next-line react/no-danger
32
+ dangerouslySetInnerHTML={{ __html: textWordsLimit(author.biography, 20) }}
33
+ />
34
+ <Link className={styles.readMore} to={author.profile_page_path}>
35
+ {translate(translations, 'read_more', 'Read More')} <FaArrowRight size="1.4rem" />
36
+ </Link>
37
+ </div>
38
+ );
39
+ }
40
+
41
+ TemplateOne.propTypes = {
42
+ item: PropTypes.shape({
43
+ relation: PropTypes.shape({
44
+ author_title: PropTypes.string,
45
+ name: PropTypes.string,
46
+ profile_page_path: PropTypes.string,
47
+ biography: PropTypes.string,
48
+ pages_count: PropTypes.string,
49
+ image_alt: PropTypes.string,
50
+ image_object: PropTypes.shape({
51
+ filename: PropTypes.string,
52
+ image_alt: PropTypes.string,
53
+ }),
54
+ }),
55
+ }),
56
+ };
@@ -0,0 +1,77 @@
1
+ .container {
2
+ background: #ffffff;
3
+ border: 0.15rem solid #e9e9e9;
4
+ border-radius: 1.6rem;
5
+ @include flex-align(flex-start, flex-start);
6
+ flex-direction: column;
7
+ padding: 2.4rem;
8
+ position: relative;
9
+
10
+ > img {
11
+ margin-bottom: 1.6rem;
12
+ border-radius: 4rem;
13
+ }
14
+
15
+ > a {
16
+ @include flex-align(flex-end, flex-start);
17
+ flex-grow: 1;
18
+ }
19
+ }
20
+
21
+ .socials {
22
+ a {
23
+ height: 2.4rem !important;
24
+ width: 2.4rem !important;
25
+ }
26
+ }
27
+
28
+ .posts {
29
+ position: absolute;
30
+ background: #5545a9;
31
+ border-radius: 100px;
32
+ color: #fff;
33
+ top: 2.4rem;
34
+ right: 2.4rem;
35
+ letter-spacing: 0.5px;
36
+ text-transform: uppercase;
37
+ font-weight: 700;
38
+ font-size: 10px;
39
+ line-height: 13px;
40
+ padding: 0.6rem;
41
+ }
42
+
43
+ .title {
44
+ font-weight: 700;
45
+ font-size: 13px;
46
+ line-height: 19px;
47
+ letter-spacing: 0.16em;
48
+ text-transform: uppercase;
49
+ color: #737090;
50
+ }
51
+
52
+ .name {
53
+ color: #000;
54
+ font-weight: 700;
55
+ font-size: 20px;
56
+ margin-bottom: 1.6rem;
57
+ line-height: 30px;
58
+ }
59
+
60
+ .bio {
61
+ font-size: 16px;
62
+ line-height: 27px;
63
+ margin-top: 2.4rem;
64
+ }
65
+
66
+ .readMore {
67
+ font-weight: 700;
68
+ font-size: 14px;
69
+ line-height: 18px;
70
+ color: #1c1a28;
71
+ margin-top: 1rem;
72
+
73
+ svg {
74
+ margin-left: .8rem;
75
+ margin-bottom: .1rem;
76
+ }
77
+ }
@@ -0,0 +1,42 @@
1
+ /* eslint-disable react/destructuring-assignment */
2
+ import React from 'react';
3
+ import { Context } from 'gatsby-core-theme/src/context/MainProvider';
4
+ import getAuthorList from '../../../../../../tests/factories/authors/author.factory';
5
+ import TemplateOne from '.';
6
+
7
+ const author = getAuthorList({})[1];
8
+
9
+ export default {
10
+ title: 'Matrix-Theme/Modules/Cards/Author/Template One',
11
+ component: TemplateOne,
12
+ argTypes: {
13
+ item: {
14
+ relation: {
15
+ ...author,
16
+ },
17
+ },
18
+ },
19
+ };
20
+
21
+ const Template = (args) => (
22
+ <div
23
+ style={{
24
+ maxWidth: ' 34.3rem',
25
+ margin: '0 auto',
26
+ }}
27
+ >
28
+ <Context.Provider value={{}}>
29
+ <TemplateOne {...args} />
30
+ </Context.Provider>
31
+ </div>
32
+ );
33
+
34
+ export const Default = Template.bind({});
35
+
36
+ Default.args = {
37
+ item: {
38
+ relation: {
39
+ ...author,
40
+ },
41
+ },
42
+ };
@@ -0,0 +1,29 @@
1
+ /* eslint-disable no-multi-assign */
2
+ import React from 'react';
3
+ import { Context } from 'gatsby-core-theme/src/context/MainProvider';
4
+ import { render, cleanup } from '@testing-library/react';
5
+ import '@testing-library/jest-dom/extend-expect';
6
+ import getAuthorList from '../../../../../../tests/factories/authors/author.factory';
7
+ import TemplateOne from '.';
8
+ import { textWordsLimit } from '~helpers/getters';
9
+
10
+ describe('Author Header', () => {
11
+ test('Template One', () => {
12
+ const author = getAuthorList({})[1];
13
+ const { container, getByText } = render(<TemplateOne item={{ relation: { ...author } }} />, {
14
+ wrapper: ({ children }) => <Context.Provider value={{}}>{children}</Context.Provider>,
15
+ });
16
+ expect(getByText('Author 1 Name')).toBeTruthy();
17
+ expect(getByText(author.author_title)).toBeTruthy();
18
+ expect(getByText('23 Posts')).toBeTruthy();
19
+ expect(getByText(textWordsLimit(author.biography, 20))).toBeTruthy();
20
+ expect(container.querySelectorAll('a')).toHaveLength(6);
21
+ expect(getByText('Read More').closest('a').getAttribute('href')).toEqual(
22
+ `/${author.profile_page_path}`
23
+ );
24
+ });
25
+ });
26
+
27
+ afterEach(() => {
28
+ cleanup();
29
+ });
@@ -0,0 +1,51 @@
1
+ import React, { useContext } from 'react';
2
+ import { Context } from 'gatsby-core-theme/src/context/MainProvider';
3
+ import Link from 'gatsby-core-theme/src/hooks/link';
4
+ import PropTypes from 'prop-types';
5
+ import LazyImage from '~hooks/lazy-image';
6
+ import Socials from '../../../author/socials';
7
+ import styles from './template-two.module.scss';
8
+ import { imagePrettyUrl, getAltText, translate } from '~helpers/getters';
9
+
10
+ export default function TemplateTwo({ item }) {
11
+ const author = item.relation;
12
+ const { translations } = useContext(Context);
13
+
14
+ return (
15
+ <div className={styles.container}>
16
+ <LazyImage
17
+ src={imagePrettyUrl(author.image_object.filename, 80, 80)}
18
+ alt={getAltText(author.image_object, author.image_alt || author.name)}
19
+ width={80}
20
+ height={80}
21
+ />
22
+ <div className={styles.nameContainer}>
23
+ <span className={styles.title}>{author.author_title}</span>
24
+ <Link className={styles.name} to={author.profile_page_path}>
25
+ {author.name}
26
+ </Link>
27
+ </div>
28
+ <span className={styles.posts}>
29
+ {author.pages_count} {translate(translations, 'posts', 'Posts')}
30
+ </span>
31
+ <Socials className={styles.socials} author={author} />
32
+ </div>
33
+ );
34
+ }
35
+
36
+ TemplateTwo.propTypes = {
37
+ item: PropTypes.shape({
38
+ relation: PropTypes.shape({
39
+ author_title: PropTypes.string,
40
+ name: PropTypes.string,
41
+ profile_page_path: PropTypes.string,
42
+ biography: PropTypes.string,
43
+ pages_count: PropTypes.string,
44
+ image_alt: PropTypes.string,
45
+ image_object: PropTypes.shape({
46
+ filename: PropTypes.string,
47
+ image_alt: PropTypes.string,
48
+ }),
49
+ }),
50
+ }),
51
+ };
@@ -0,0 +1,70 @@
1
+ .container {
2
+ background: #ffffff;
3
+ border: 0.15rem solid #e9e9e9;
4
+ border-radius: 1.6rem;
5
+ @include flex-align(center, space-between);
6
+ gap: 1.6rem;
7
+ flex-direction: column;
8
+ padding: 2.4rem;
9
+ position: relative;
10
+
11
+ > img {
12
+ border-radius: 4rem;
13
+ }
14
+ }
15
+
16
+ .posts {
17
+ background: #5545a9;
18
+ border-radius: 100px;
19
+ color: #fff;
20
+ top: 2.4rem;
21
+ right: 2.4rem;
22
+ letter-spacing: 0.5px;
23
+ text-transform: uppercase;
24
+ font-weight: 700;
25
+ font-size: 10px;
26
+ line-height: 13px;
27
+ padding: 0.6rem;
28
+ }
29
+
30
+ .socials {
31
+ a {
32
+ height: 2.4rem !important;
33
+ width: 2.4rem !important;
34
+ }
35
+ }
36
+
37
+ .title {
38
+ font-weight: 700;
39
+ font-size: 13px;
40
+ line-height: 19px;
41
+ letter-spacing: 0.16em;
42
+ text-transform: uppercase;
43
+ color: #737090;
44
+ text-align: center;
45
+ }
46
+
47
+ .nameContainer {
48
+ @include flex-align(center, center);
49
+ flex-direction: column;
50
+ }
51
+
52
+ .name {
53
+ color: #000;
54
+ font-weight: 700;
55
+ font-size: 20px;
56
+ line-height: 30px;
57
+ position: relative;
58
+
59
+ &:after {
60
+ @include arrow(var(--horse-calc-label-color, #000), 0.8rem, down, false);
61
+ position: absolute;
62
+ right: -1.5rem;
63
+ top: 38%;
64
+ }
65
+ }
66
+
67
+ .bio {
68
+ font-size: 16px;
69
+ line-height: 27px;
70
+ }
@@ -0,0 +1,42 @@
1
+ /* eslint-disable react/destructuring-assignment */
2
+ import React from 'react';
3
+ import { Context } from 'gatsby-core-theme/src/context/MainProvider';
4
+ import getAuthorList from '../../../../../../tests/factories/authors/author.factory';
5
+ import TemplateTwo from '.';
6
+
7
+ const author = getAuthorList({})[1];
8
+
9
+ export default {
10
+ title: 'Matrix-Theme/Modules/Cards/Author/Template Two',
11
+ component: TemplateTwo,
12
+ argTypes: {
13
+ item: {
14
+ relation: {
15
+ ...author,
16
+ },
17
+ },
18
+ },
19
+ };
20
+
21
+ const Template = (args) => (
22
+ <div
23
+ style={{
24
+ maxWidth: ' 34.3rem',
25
+ margin: '0 auto',
26
+ }}
27
+ >
28
+ <Context.Provider value={{}}>
29
+ <TemplateTwo {...args} />
30
+ </Context.Provider>
31
+ </div>
32
+ );
33
+
34
+ export const Default = Template.bind({});
35
+
36
+ Default.args = {
37
+ item: {
38
+ relation: {
39
+ ...author,
40
+ },
41
+ },
42
+ };
@@ -0,0 +1,27 @@
1
+ /* eslint-disable no-multi-assign */
2
+ import React from 'react';
3
+ import { Context } from 'gatsby-core-theme/src/context/MainProvider';
4
+ import { render, cleanup } from '@testing-library/react';
5
+ import '@testing-library/jest-dom/extend-expect';
6
+ import getAuthorList from '../../../../../../tests/factories/authors/author.factory';
7
+ import TemplateOne from '.';
8
+
9
+ describe('Author Header', () => {
10
+ test('Template One', () => {
11
+ const author = getAuthorList({})[1];
12
+ const { container, getByText } = render(<TemplateOne item={{ relation: { ...author } }} />, {
13
+ wrapper: ({ children }) => <Context.Provider value={{}}>{children}</Context.Provider>,
14
+ });
15
+ expect(getByText('Author 1 Name')).toBeTruthy();
16
+ expect(getByText(author.author_title)).toBeTruthy();
17
+ expect(getByText('23 Posts')).toBeTruthy();
18
+ expect(container.querySelectorAll('a')).toHaveLength(6);
19
+ expect(getByText('Author 1 Name').closest('a').getAttribute('href')).toEqual(
20
+ `/${author.profile_page_path}`
21
+ );
22
+ });
23
+ });
24
+
25
+ afterEach(() => {
26
+ cleanup();
27
+ });
@@ -13,7 +13,7 @@ export default function ComparisonTable({ module, page }) {
13
13
  <div className={styles.comparisonTable}>
14
14
  <ScrollX refTag={ele} scroll>
15
15
  <div ref={ele} className={styles.contentTable}>
16
- <Table type={page?.type} items={module?.items} tempate={page?.template} />
16
+ <Table type={page?.relation_type} items={module?.items} tempate={page?.template} />
17
17
  </div>
18
18
  </ScrollX>
19
19
  </div>
@@ -25,6 +25,7 @@ ComparisonTable.propTypes = {
25
25
  items: PropTypes.shape({}),
26
26
  }),
27
27
  page: PropTypes.shape({
28
+ relation_type: PropTypes.string,
28
29
  type: PropTypes.string,
29
30
  template: PropTypes.string,
30
31
  }),
@@ -18,8 +18,8 @@ import styles from './template-one.module.scss';
18
18
 
19
19
  const TemplateOneTwo = ({ item, showSellingPoints = true, width = 150, height = 150 }) => {
20
20
  const { translations } = useContext(Context);
21
- const { title, path, relation, sections, description } = item;
22
- const { name, selling_points } = item.relation;
21
+ const { title, path, relation, sections, description } = item || {};
22
+ const { name, selling_points } = item?.relation || {};
23
23
 
24
24
  const imageObject = relation?.standardised_logo_filename_object || relation?.logo_filename_object;
25
25
  const StarRating = loadable(() =>
@@ -47,7 +47,12 @@ const TemplateOneTwo = ({ item, showSellingPoints = true, width = 150, height =
47
47
 
48
48
  <div className={`${styles.links}`}>
49
49
  <span className={styles.title}>{name}</span>
50
- <StarRating numOfStars={5} halfStars={false} rating={relation.rating} showDot={false} />
50
+ <StarRating
51
+ numOfStars={5}
52
+ halfStars={false}
53
+ rating={relation?.rating}
54
+ showDot={false}
55
+ />
51
56
  </div>
52
57
  </div>
53
58
 
@@ -12,8 +12,8 @@ import SellingPoints from '../sellingPoints';
12
12
  import styles from './template-three.module.scss';
13
13
 
14
14
  const TemplateThree = ({ item, width = 150, height = 150 }) => {
15
- const { title, path, relation } = item;
16
- const { name, selling_points } = item.relation;
15
+ const { title, path, relation } = item || {};
16
+ const { name, selling_points } = item?.relation || {};
17
17
 
18
18
  const imageObject = relation?.standardised_logo_filename_object || relation?.logo_filename_object;
19
19
  const StarRating = loadable(() =>
@@ -41,7 +41,12 @@ const TemplateThree = ({ item, width = 150, height = 150 }) => {
41
41
  <div className={`${styles.links}`}>
42
42
  <span className={styles.title}>{name}</span>
43
43
 
44
- <StarRating numOfStars={5} halfStars={false} rating={relation.rating} showDot={false} />
44
+ <StarRating
45
+ numOfStars={5}
46
+ halfStars={false}
47
+ rating={relation?.rating}
48
+ showDot={false}
49
+ />
45
50
  </div>
46
51
  </div>
47
52
 
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import Portrait from '../assets/portrait';
5
5
  import Name from '../assets/name';
6
- import Socials from '../assets/socials';
6
+ import Socials from '../../../../../atoms/author/socials';
7
7
  import styles from './template-four.module.scss';
8
8
 
9
9
  export default function TemplateFour({ author, icons, authorTitle }) {
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import Portrait from '../assets/portrait';
5
5
  import Name from '../assets/name';
6
- import Socials from '../assets/socials';
6
+ import Socials from '../../../../../atoms/author/socials';
7
7
  import Expertise from '../assets/expertise';
8
8
  import styles from './template-one.module.scss';
9
9
 
@@ -18,6 +18,7 @@ export default function TemplateOne({ author, icons, authorTitle }) {
18
18
  {author.biography && (
19
19
  <div
20
20
  className={styles.biography}
21
+ // eslint-disable-next-line react/no-danger
21
22
  dangerouslySetInnerHTML={{ __html: author.biography }}
22
23
  />
23
24
  )}
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import Portrait from '../assets/portrait';
5
5
  import Name from '../assets/name';
6
- import Socials from '../assets/socials';
6
+ import Socials from '../../../../../atoms/author/socials';
7
7
  import Expertise from '../assets/expertise';
8
8
  import styles from './template-three.module.scss';
9
9
 
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import Portrait from '../assets/portrait';
5
5
  import Name from '../assets/name';
6
- import Socials from '../assets/socials';
6
+ import Socials from '../../../../../atoms/author/socials';
7
7
  import Expertise from '../assets/expertise';
8
8
  import styles from './template-two.module.scss';
9
9
 
@@ -21,7 +21,8 @@ const OperatorSummary = ({
21
21
  defaultBg,
22
22
  }) => {
23
23
  let operatorData = page?.extra_fields?.related_operator;
24
- if (page.type === 'operator') {
24
+
25
+ if (page?.relation_type === 'operator') {
25
26
  operatorData = page?.relation;
26
27
  }
27
28
 
@@ -80,6 +81,7 @@ OperatorSummary.propTypes = {
80
81
  defaultBg: PropTypes.string,
81
82
  page: PropTypes.shape({
82
83
  market: PropTypes.string,
84
+ relation_type: PropTypes.string,
83
85
  extra_fields: PropTypes.shape({
84
86
  summary: PropTypes.string,
85
87
  summary_background: PropTypes.string,
@@ -83,7 +83,7 @@ const ModuleTitle = ({
83
83
  };
84
84
 
85
85
  const template = pageContext && pageContext?.page?.template;
86
- const type = pageContext && pageContext?.page?.type;
86
+ const type = pageContext && pageContext?.page?.relation_type;
87
87
  const seeMore = module?.see_more_link?.title;
88
88
 
89
89
  return module.module_title ||
@@ -8,7 +8,7 @@ function getHeaderSection(type = 'page', template = 'author') {
8
8
  const header = {
9
9
  section: {
10
10
  page: {
11
- type: `${type}`,
11
+ relation_type: `${type}`,
12
12
  template: `${template}`,
13
13
  title: 'The Page Title',
14
14
  path: 'sport/brand',
@@ -10,12 +10,12 @@ import styles from './header.module.scss';
10
10
  export const relationContent = (section, numOfStarsRating) => {
11
11
  let ModuleComponent = null;
12
12
 
13
- switch (section?.page?.type) {
13
+ switch (section?.page?.relation_type) {
14
14
  case 'payment_method': {
15
15
  const data = {
16
16
  page: section?.page,
17
17
  relation: section?.page?.relation || {},
18
- type: section?.page?.type,
18
+ type: section?.page?.relation_type,
19
19
  template: section?.page?.page_styles?.short_name,
20
20
  pageTemplate: section?.page?.template,
21
21
  sections: section?.page?.sections,
@@ -68,7 +68,7 @@ export const relationContent = (section, numOfStarsRating) => {
68
68
  const data = {
69
69
  page: section?.page,
70
70
  author: section?.page.author,
71
- type: section?.page?.type,
71
+ type: section?.page?.relation_type,
72
72
  template: section?.page?.page_styles?.short_name,
73
73
  pageTemplate: section?.page?.template,
74
74
  relation: section?.page?.relation || {},
@@ -242,7 +242,6 @@ Header.propTypes = {
242
242
  }),
243
243
  }),
244
244
  title: PropTypes.string,
245
- type: PropTypes.string,
246
245
  reading_time: PropTypes.string,
247
246
  reviewer_id: PropTypes.string,
248
247
  reviewer: PropTypes.shape({}),
@@ -17,8 +17,8 @@ const Main = ({ section = {}, pageContext = {}, showAuthor = true, exclOperator
17
17
  const siteName = process.env.GATSBY_SITE_NAME;
18
18
  const showNewsletter = !(
19
19
  settings[siteName]?.filter_pages?.includes('*') ||
20
- settings[siteName]?.filter_pages?.includes(page.type) ||
21
- settings.default?.filter_pages?.includes(page.type)
20
+ settings[siteName]?.filter_pages?.includes(page?.relation_type) ||
21
+ settings.default?.filter_pages?.includes(page?.relation_type)
22
22
  );
23
23
  const SearchPage =
24
24
  page.path === 's'
@@ -34,7 +34,7 @@ const Modules = ({ module, page, pageContext, index, exclOperator }) => {
34
34
  return loadable(() => import('../../../../components/atoms/cards/comparison-table'));
35
35
  }
36
36
 
37
- return loadable(() => import('../../organisms/cards'));
37
+ return loadable(() => import('gatsby-core-theme/src/components/organisms/cards'));
38
38
  case 'pros_and_cons':
39
39
  return loadable(() => import('gatsby-core-theme/src/components/molecules/pros-cons'));
40
40
  case 'accordion':