gatsby-matrix-theme 13.0.3 → 13.0.4

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 (39) hide show
  1. package/.storybook/preview.js +2 -0
  2. package/CHANGELOG.md +38 -0
  3. package/package.json +1 -1
  4. package/src/components/molecules/header/variants/author/assets/expertise/expertise.module.scss +44 -0
  5. package/src/components/molecules/header/variants/author/assets/expertise/index.js +40 -0
  6. package/src/components/molecules/header/variants/author/assets/name/index.js +30 -0
  7. package/src/components/molecules/header/variants/author/assets/name/name.module.scss +27 -0
  8. package/src/components/molecules/header/variants/author/assets/portrait/index.js +40 -0
  9. package/src/components/molecules/header/variants/author/assets/portrait/portrait.module.scss +8 -0
  10. package/src/components/molecules/header/variants/author/assets/socials/index.js +50 -0
  11. package/src/components/molecules/header/variants/author/assets/socials/socials.module.scss +26 -0
  12. package/src/components/molecules/header/variants/author/template-four/index.js +38 -0
  13. package/src/components/molecules/header/variants/author/template-four/template-four.module.scss +68 -0
  14. package/src/components/molecules/header/variants/author/template-four/template-four.stories.js +39 -0
  15. package/src/components/molecules/header/variants/author/template-four/template-four.test.js +38 -0
  16. package/src/components/molecules/header/variants/author/template-one/index.js +49 -0
  17. package/src/components/molecules/header/variants/author/template-one/template-one.module.scss +88 -0
  18. package/src/components/molecules/header/variants/author/template-one/template-one.stories.js +41 -0
  19. package/src/components/molecules/header/variants/author/template-one/template-one.test.js +23 -0
  20. package/src/components/molecules/header/variants/author/template-three/index.js +41 -0
  21. package/src/components/molecules/header/variants/author/template-three/template-three.module.scss +105 -0
  22. package/src/components/molecules/header/variants/author/template-three/template-three.stories.js +41 -0
  23. package/src/components/molecules/header/variants/author/template-three/template-three.test.js +41 -0
  24. package/src/components/molecules/header/variants/author/template-two/index.js +41 -0
  25. package/src/components/molecules/header/variants/author/template-two/template-two.module.scss +69 -0
  26. package/src/components/molecules/header/variants/author/template-two/template-two.stories.js +41 -0
  27. package/src/components/molecules/header/variants/author/template-two/template-two.test.js +41 -0
  28. package/src/gatsby-core-theme/components/molecules/header/header.test.js +26 -20
  29. package/src/gatsby-core-theme/components/molecules/header/index.js +26 -0
  30. package/storybook/public/{371.705c11f4.iframe.bundle.js → 434.757b8672.iframe.bundle.js} +3 -3
  31. package/storybook/public/{371.705c11f4.iframe.bundle.js.LICENSE.txt → 434.757b8672.iframe.bundle.js.LICENSE.txt} +0 -0
  32. package/storybook/public/{371.705c11f4.iframe.bundle.js.map → 434.757b8672.iframe.bundle.js.map} +1 -1
  33. package/storybook/public/iframe.html +1 -1
  34. package/storybook/public/main.b6d41d26.iframe.bundle.js +1 -0
  35. package/storybook/public/static/media/check.5e5ea2ac.svg +3 -0
  36. package/storybook-images/check.svg +3 -0
  37. package/tests/factories/authors/author.factory.js +54 -0
  38. package/src/components/molecules/header/variants/author/index.js +0 -12
  39. package/storybook/public/main.314aafd1.iframe.bundle.js +0 -1
@@ -28,6 +28,8 @@ export const parameters = {
28
28
  'Header',
29
29
  [
30
30
  'Default',
31
+ 'Author',
32
+ ['Template One', 'Template Two', 'Template Three', 'Template Four'],
31
33
  'Operator',
32
34
  ['Template One-Two', 'Template Three', 'Template Four', 'Template Five'],
33
35
  ],
package/CHANGELOG.md CHANGED
@@ -1,3 +1,41 @@
1
+ ## [13.0.4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v13.0.3...v13.0.4) (2023-02-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * author template one ([c1cf66c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/c1cf66cc40161e9d1411bdf87cc57a3cab7159d3))
7
+
8
+
9
+ ### Code Refactoring
10
+
11
+ * add author header component variants ([42a6def](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/42a6def6aa621893290df056451198069fe52204))
12
+ * add author header stories variants ([7bae43c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7bae43ce6645de1cd0a874280a4c2c29b4a035c0))
13
+ * add author header styles variants ([68da037](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/68da0370c831b252f46f01d4b78932e202189844))
14
+ * add author header tests variants ([1861772](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/18617722c095cc7541743a9f04478bf15f76edea))
15
+ * add author header variants in preview for storybook ([5847ac9](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5847ac9ccb6831233f597a0e91c59b4ab87e170d))
16
+ * add author header variants into main header ([0788be0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0788be05acfb8c8a2f6bb60156fa3c55ab75f6d7))
17
+ * update author header template one ([6996650](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6996650a98296d6299968f0f0b5df90f796c002c))
18
+ * update author header variant styles ([54ea464](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/54ea46420dcb41bf9cf22d218b396ff5c8b78d96))
19
+ * update author header variant styles ([c718828](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/c7188286a3dd7d1b1133f87b0cecb0979ab3dd22))
20
+ * update author header variant three gradient ([71bde8a](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/71bde8a59aee4b93d89ca56b46049636967881d6))
21
+ * update author header variants border radius ([c594434](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/c594434e6d8f3379bbd9f40535b83fdfac74c9ef))
22
+ * update author header variants border radius and style ([b09647f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b09647fd9a0dded39b0a925227da63949b65eabd))
23
+ * update author header variants colors ([3011bd0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/3011bd06192bec6ebcc6f15c2bcc18ffa4e71ad7))
24
+ * update author header variants styles ([ddd9f7e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ddd9f7e64a153fdc067f93fa2d6de4b215a7f68e))
25
+ * update author templates and assets ([7a03a35](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7a03a35e50abbe3d335fbb40f56a82222a2f4f3b))
26
+ * update header component tests ([4a088f4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4a088f474d92c2d448b528acd8909291889bf2b6))
27
+ * update main header component tests ([0f72790](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0f72790ff8ebfd912cf57071640396bec813cbab))
28
+
29
+
30
+ ### Config
31
+
32
+ * update gatsby theme version ([07eaa3d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/07eaa3d4e033f4d00e0f460b85d481c225206dab))
33
+
34
+
35
+ * Merge branch 'tm-3271-author-header-update' into 'master' ([92fe33c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/92fe33c940400a3916d404c7ef559463a13188a6))
36
+ * Merge branch 'tm-3271-author-header-update' into 'master' ([6e0d9ad](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6e0d9addb3f06e12c1deebbdd72271a1878767bf))
37
+ * Merge branch 'master' into 'tm-3271-author-header-update' ([d552070](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d55207091a573b7dd4dd7e00bcf93704ebae6f95))
38
+
1
39
  ## [13.0.3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v13.0.2...v13.0.3) (2023-02-07)
2
40
 
3
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "13.0.3",
3
+ "version": "13.0.4",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -0,0 +1,44 @@
1
+ .expertise {
2
+ display: flex;
3
+ flex-direction: column;
4
+ color: #3e3c47;
5
+
6
+ @include min(tablet) {
7
+ flex-direction: row;
8
+ align-items: baseline;
9
+ }
10
+
11
+ > span {
12
+ margin-bottom: 1.6rem;
13
+ line-height: 2.2rem;
14
+ font-size: 1.4rem;
15
+ font-weight: 600;
16
+
17
+ @include min(tablet) {
18
+ margin-right: 0.8rem;
19
+ margin-bottom: 0;
20
+ white-space: nowrap;
21
+ }
22
+ }
23
+
24
+ > ul {
25
+ display: flex;
26
+ flex-wrap: wrap;
27
+
28
+ > li {
29
+ margin-right: 0.8rem;
30
+ margin-bottom: 0.8rem;
31
+ padding: 0.2rem 0.8rem;
32
+ line-height: 2rem;
33
+ font-size: 1.2rem;
34
+ font-weight: 500;
35
+ border: 1px solid #e9e9e9;
36
+ border-radius: 10rem;
37
+ background-color: #f6f6f6;
38
+
39
+ > img {
40
+ margin-right: 0.75rem;
41
+ }
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,40 @@
1
+ /* eslint-disable react/forbid-prop-types */
2
+ import React, { useContext } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import LazyImage from '~hooks/lazy-image';
5
+ import { translate } from '~helpers/getters';
6
+ import { Context } from '~context/MainProvider';
7
+ import styles from './expertise.module.scss';
8
+
9
+ export default function TemplateOne({ className = '', expertise, icon }) {
10
+ const { translations } = useContext(Context) || {};
11
+
12
+ return (
13
+ expertise && (
14
+ <div className={`${className} ${styles.expertise}`}>
15
+ <span>{translate(translations, 'expert_on', 'Expert on')}: </span>
16
+ <ul>
17
+ {expertise.map((item, index) => (
18
+ // eslint-disable-next-line react/no-array-index-key
19
+ <li key={index}>
20
+ <LazyImage
21
+ src={icon || '../../../images/check.svg'}
22
+ alt={translate(translations, 'check', 'Check')}
23
+ loading="eager"
24
+ width={10}
25
+ height={10}
26
+ />
27
+ {item}
28
+ </li>
29
+ ))}
30
+ </ul>
31
+ </div>
32
+ )
33
+ );
34
+ }
35
+
36
+ TemplateOne.propTypes = {
37
+ className: PropTypes.string,
38
+ expertise: PropTypes.array,
39
+ icon: PropTypes.string,
40
+ };
@@ -0,0 +1,30 @@
1
+ import React, { useContext } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import LazyImage from '~hooks/lazy-image';
4
+ import { translate } from '~helpers/getters';
5
+ import { Context } from '~context/MainProvider';
6
+ import styles from './name.module.scss';
7
+
8
+ export default function Name({ className = '', name, icon }) {
9
+ const { translations } = useContext(Context) || {};
10
+
11
+ return (
12
+ <h1 className={`${className} ${styles.name}`}>
13
+ {name}
14
+ <LazyImage
15
+ className={styles.verify}
16
+ src={icon || '../../../images/verify.svg'}
17
+ alt={translate(translations, 'verified', 'Verified')}
18
+ loading="eager"
19
+ width={20}
20
+ height={20}
21
+ />
22
+ </h1>
23
+ );
24
+ }
25
+
26
+ Name.propTypes = {
27
+ className: PropTypes.string,
28
+ name: PropTypes.string,
29
+ icon: PropTypes.string,
30
+ };
@@ -0,0 +1,27 @@
1
+ .name {
2
+ margin-top: 0;
3
+ display: inline-block;
4
+ line-height: 3.4rem;
5
+ font-size: 2.4rem;
6
+ font-weight: 700;
7
+ text-transform: capitalize;
8
+ color: #1c1a28;
9
+
10
+ @include min(tablet) {
11
+ line-height: 4.2rem;
12
+ font-size: 3.2rem;
13
+ }
14
+ }
15
+
16
+ .verify {
17
+ margin-left: 0.4rem;
18
+ height: 1.6rem;
19
+ width: 1.6rem;
20
+ vertical-align: top;
21
+
22
+ @include min(tablet) {
23
+ margin-left: 0.8rem;
24
+ height: 2.4rem;
25
+ width: 2.4rem;
26
+ }
27
+ }
@@ -0,0 +1,40 @@
1
+ /* eslint-disable react/forbid-prop-types */
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import LazyImage from '~hooks/lazy-image';
5
+ import { imagePrettyUrl, getAltText } from '~helpers/getters';
6
+ import styles from './portrait.module.scss';
7
+
8
+ export default function Portrait({ className = '', author }) {
9
+ return (
10
+ author.image_object && (
11
+ <a
12
+ className={`${className} ${styles.portrait}`}
13
+ href={author.profile_page_path || '/'}
14
+ target="_blank"
15
+ rel="nofollow noreferrer"
16
+ aria-label="Profile Page Link"
17
+ >
18
+ <LazyImage
19
+ src={imagePrettyUrl(author.image_object.filename, 180, 180)}
20
+ alt={getAltText(author.image_object, author.image_alt || author.name)}
21
+ loading="eager"
22
+ width={180}
23
+ height={180}
24
+ />
25
+ </a>
26
+ )
27
+ );
28
+ }
29
+
30
+ Portrait.propTypes = {
31
+ className: PropTypes.string,
32
+ author: PropTypes.shape({
33
+ name: PropTypes.string,
34
+ image_alt: PropTypes.string,
35
+ profile_page_path: PropTypes.string,
36
+ image_object: PropTypes.shape({
37
+ filename: PropTypes.string,
38
+ }),
39
+ }),
40
+ };
@@ -0,0 +1,8 @@
1
+ .portrait {
2
+ height: fit-content;
3
+ width: fit-content;
4
+ flex: 0 0 auto;
5
+ display: flex;
6
+ border: 1.5px solid #e9e9e9;
7
+ overflow: hidden;
8
+ }
@@ -0,0 +1,50 @@
1
+ /* eslint-disable react/forbid-prop-types */
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { FaInstagram } from '@react-icons/all-files/fa/FaInstagram';
5
+ import { FaFacebookSquare } from '@react-icons/all-files/fa/FaFacebookSquare';
6
+ import { FaTwitter } from '@react-icons/all-files/fa/FaTwitter';
7
+ import { IoLogoTiktok } from '@react-icons/all-files/io5/IoLogoTiktok';
8
+ import { FaLinkedin } from '@react-icons/all-files/fa/FaLinkedin';
9
+ import styles from './socials.module.scss';
10
+
11
+ export default function Socials({ className = '', author }) {
12
+ const socialLinks = [
13
+ { id: 'fb', link: author.facebook_profile, icon: <FaFacebookSquare /> },
14
+ { id: 'ig', link: author.instagram_profile, icon: <FaInstagram /> },
15
+ { id: 'li', link: author.linkedin_profile, icon: <FaLinkedin /> },
16
+ { id: 'tw', link: author.twitter_profile, icon: <FaTwitter /> },
17
+ { id: 'tt', link: author.tik_tok, icon: <IoLogoTiktok /> },
18
+ ].filter((socialLink) => socialLink.link);
19
+
20
+ return (
21
+ socialLinks.length && (
22
+ <div className={`${className} ${styles.socials}`}>
23
+ {socialLinks.map((socialLink) => (
24
+ // eslint-disable-next-line jsx-a11y/control-has-associated-label
25
+ <a
26
+ className={`${styles.social} author-gtm`}
27
+ href={socialLink.link}
28
+ target="_blank"
29
+ rel="nofollow noreferrer"
30
+ key={`author-box-link-${socialLink.id}`}
31
+ aria-label={`${socialLink.id} Link`}
32
+ >
33
+ {socialLink.icon}
34
+ </a>
35
+ ))}
36
+ </div>
37
+ )
38
+ );
39
+ }
40
+
41
+ Socials.propTypes = {
42
+ className: PropTypes.string,
43
+ author: PropTypes.shape({
44
+ facebook_profile: PropTypes.string,
45
+ instagram_profile: PropTypes.string,
46
+ linkedin_profile: PropTypes.string,
47
+ twitter_profile: PropTypes.string,
48
+ tik_tok: PropTypes.string,
49
+ }),
50
+ };
@@ -0,0 +1,26 @@
1
+ .social {
2
+ margin-right: 0.8rem;
3
+ padding: 0.7rem;
4
+ height: 2.4rem;
5
+ width: 2.4rem;
6
+ display: inline-flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ border-radius: 50%;
10
+ background-color: #1c1a28;
11
+
12
+ @include min(tablet) {
13
+ height: 3.2rem;
14
+ width: 3.2rem;
15
+ }
16
+
17
+ > svg {
18
+ height: 1.35rem;
19
+ width: 1.35rem;
20
+ color: #ffffff;
21
+ }
22
+ }
23
+
24
+ .social:last-child {
25
+ margin-right: 0;
26
+ }
@@ -0,0 +1,38 @@
1
+ /* eslint-disable react/forbid-prop-types */
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import Portrait from '../assets/portrait';
5
+ import Name from '../assets/name';
6
+ import Socials from '../assets/socials';
7
+ import styles from './template-four.module.scss';
8
+
9
+ export default function TemplateFour({ author, icons }) {
10
+ return (
11
+ <div className={styles.container}>
12
+ <Portrait className={styles.portrait} author={author} />
13
+ <div>
14
+ <Name className={styles.name} name={author.name} icon={icons?.verify} />
15
+ <div className={styles.title}>{author.author_title}</div>
16
+ <Socials author={author} />
17
+ </div>
18
+ </div>
19
+ );
20
+ }
21
+
22
+ TemplateFour.propTypes = {
23
+ author: PropTypes.shape({
24
+ name: PropTypes.string,
25
+ author_title: PropTypes.string,
26
+ image_alt: PropTypes.string,
27
+ profile_page_path: PropTypes.string,
28
+ facebook_profile: PropTypes.string,
29
+ instagram_profile: PropTypes.string,
30
+ linkedin_profile: PropTypes.string,
31
+ twitter_profile: PropTypes.string,
32
+ tik_tok: PropTypes.string,
33
+ image_object: PropTypes.shape({
34
+ filename: PropTypes.string,
35
+ }),
36
+ }),
37
+ icons: PropTypes.object,
38
+ };
@@ -0,0 +1,68 @@
1
+ .container {
2
+ margin: 4.4rem max(1.6rem, 50% - 37.5rem / 2) 0;
3
+ padding: 4rem;
4
+ max-width: 37.5rem;
5
+ @include flex-direction(column);
6
+ align-items: center;
7
+ border: 1.5px solid #e9e9e9;
8
+ border-radius: 1.6rem;
9
+ background: linear-gradient(94.15deg, #f9f6e7 1.69%, #ffffff 49.54%, #dddaee 100%);
10
+
11
+ > div {
12
+ @include flex-direction(column);
13
+ align-items: center;
14
+ }
15
+
16
+ @include min(tablet) {
17
+ margin: 0;
18
+ padding: 3.2rem;
19
+ max-width: 100%;
20
+ border-radius: 0;
21
+
22
+ > div {
23
+ margin-top: 3.4rem;
24
+ }
25
+ }
26
+ }
27
+
28
+ .portrait {
29
+ margin-top: -6.7rem;
30
+ margin-bottom: 5.1rem;
31
+ border-radius: 50%;
32
+
33
+ @include min(tablet) {
34
+ margin-top: 0;
35
+ margin-bottom: 0;
36
+ }
37
+
38
+ > img {
39
+ height: 9.6rem;
40
+ width: 9.6rem;
41
+
42
+ @include min(tablet) {
43
+ height: 27.6rem;
44
+ width: 27.6rem;
45
+ }
46
+ }
47
+ }
48
+
49
+ .name {
50
+ margin-bottom: 0.8rem;
51
+ text-align: center;
52
+ }
53
+
54
+ .title {
55
+ margin-bottom: 2.4rem;
56
+ line-height: 1.9rem;
57
+ font-size: 1.3rem;
58
+ font-weight: 700;
59
+ letter-spacing: 0.16em;
60
+ text-align: center;
61
+ text-transform: uppercase;
62
+ color: #6b6a72;
63
+
64
+ @include min(tablet) {
65
+ line-height: 2.4rem;
66
+ font-size: 1.6rem;
67
+ }
68
+ }
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import getAuthorList from '../../../../../../../tests/factories/authors/author.factory';
3
+ import verifyIcon from '../../../../../../../storybook-images/verify.svg';
4
+ import TemplateFour from '.';
5
+
6
+ const author = getAuthorList({})[1];
7
+ export default {
8
+ title: 'Matrix-Theme/Layout/Header/Author/Template Four',
9
+ component: TemplateFour,
10
+ author: {
11
+ name: 'author',
12
+ type: { name: 'object', required: false },
13
+ defaultValue: null,
14
+ description: 'The author object.',
15
+ },
16
+ translations: {
17
+ name: 'translations',
18
+ type: { name: 'object', required: false },
19
+ defaultValue: {
20
+ verified: 'Verified LANG',
21
+ expert_on: 'Expert on LANG',
22
+ },
23
+ description: 'The translations object',
24
+ },
25
+ };
26
+
27
+ const Template = (args) => <TemplateFour {...args} />;
28
+ export const Default = Template.bind({});
29
+ Default.args = {
30
+ // eslint-disable-next-line object-shorthand
31
+ author: author,
32
+ icons: {
33
+ verify: verifyIcon,
34
+ },
35
+ translations: {
36
+ verified: 'Verified LANG',
37
+ expert_on: 'Expert on LANG',
38
+ },
39
+ };
@@ -0,0 +1,38 @@
1
+ /* eslint-disable no-multi-assign */
2
+ import React from 'react';
3
+ import { render, cleanup } from '@testing-library/react';
4
+ import '@testing-library/jest-dom/extend-expect';
5
+ import TemplateFour from '.';
6
+
7
+ describe('Author Header', () => {
8
+ test('Template Four', () => {
9
+ const { container, getByText } = render(
10
+ <TemplateFour
11
+ author={{
12
+ name: 'Ida Moen Olsen',
13
+ author_title: 'Online Casino Specialist',
14
+ image_object: {
15
+ filename:
16
+ 'https://assets-srv.s3.eu-west-1.amazonaws.com/2020-09-25-15-01-46-imagesjpeg-191264.png',
17
+ width: '150',
18
+ height: '150',
19
+ },
20
+ image_alt: 'image-alt',
21
+ facebook_profile: 'https://www.irishluck.ie',
22
+ instagram_profile: 'https://www.irishluck.ie',
23
+ linkedin_profile: 'https://www.irishluck.ie',
24
+ twitter_profile: 'https://www.irishluck.ie',
25
+ tik_tok: 'https://www.irishluck.ie',
26
+ profile_page_path: '/',
27
+ }}
28
+ />
29
+ );
30
+ expect(getByText('Ida Moen Olsen')).toBeTruthy();
31
+ expect(getByText('Online Casino Specialist')).toBeTruthy();
32
+ expect(container.querySelectorAll('a')).toHaveLength(6);
33
+ });
34
+ });
35
+
36
+ afterEach(() => {
37
+ cleanup();
38
+ });
@@ -0,0 +1,49 @@
1
+ /* eslint-disable react/forbid-prop-types */
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import Portrait from '../assets/portrait';
5
+ import Name from '../assets/name';
6
+ import Socials from '../assets/socials';
7
+ import Expertise from '../assets/expertise';
8
+ import styles from './template-one.module.scss';
9
+
10
+ export default function TemplateOne({ author, icons }) {
11
+ return (
12
+ <div className={styles.container}>
13
+ <Portrait className={styles.portrait} author={author} />
14
+ <div>
15
+ <div className={styles.title}>{author.author_title}</div>
16
+ <Name className={styles.name} name={author.name} icon={icons?.verify} />
17
+ <Socials className={styles.socials} author={author} />
18
+ {author.biography && (
19
+ <div
20
+ className={styles.biography}
21
+ dangerouslySetInnerHTML={{ __html: author.biography }}
22
+ />
23
+ )}
24
+ <Expertise expertise={author.expertise} icon={icons?.expertise} />
25
+ </div>
26
+ </div>
27
+ );
28
+ }
29
+
30
+ TemplateOne.propTypes = {
31
+ author: PropTypes.shape({
32
+ name: PropTypes.string,
33
+ author_title: PropTypes.string,
34
+ biography: PropTypes.string,
35
+ image_alt: PropTypes.string,
36
+ expertise: PropTypes.array,
37
+ icon: PropTypes.object,
38
+ profile_page_path: PropTypes.string,
39
+ facebook_profile: PropTypes.string,
40
+ instagram_profile: PropTypes.string,
41
+ linkedin_profile: PropTypes.string,
42
+ twitter_profile: PropTypes.string,
43
+ tik_tok: PropTypes.string,
44
+ image_object: PropTypes.shape({
45
+ filename: PropTypes.string,
46
+ }),
47
+ }),
48
+ icons: PropTypes.object,
49
+ };
@@ -0,0 +1,88 @@
1
+ .container {
2
+ margin: 1.8rem max(1.6rem, 50% - 37.5rem / 2) 0;
3
+ padding: 1.6rem;
4
+ max-width: 37.5rem;
5
+ @include flex-direction(column);
6
+ border: 1.5px solid #e9e9e9;
7
+ border-radius: 1.6rem;
8
+ background-color: #ffffff;
9
+
10
+ @include min(tablet) {
11
+ margin: 1.8rem max(1.6rem, 50% - calc(var(--main-container-max) - 4.8rem) / 2) 0;
12
+ padding: 2.4rem;
13
+ max-width: calc(var(--main-container-max) - 4.8rem);
14
+ flex-direction: row;
15
+
16
+ > div {
17
+ margin-left: 4.8rem;
18
+ padding-top: 1.2rem;
19
+ }
20
+ }
21
+ }
22
+
23
+ .portrait {
24
+ margin-top: -3.4rem;
25
+ margin-bottom: 2.4rem;
26
+ border-radius: 1.6rem;
27
+
28
+ @include min(tablet) {
29
+ margin-top: 0;
30
+ margin-bottom: 0;
31
+ }
32
+
33
+ > img {
34
+ height: 10.4rem;
35
+ width: 10.4rem;
36
+
37
+ @include min(tablet) {
38
+ height: 27.6rem;
39
+ width: 27.6rem;
40
+ }
41
+ }
42
+ }
43
+
44
+ .name {
45
+ margin-bottom: 1.6rem;
46
+ }
47
+
48
+ .title {
49
+ margin-bottom: 0.8rem;
50
+ line-height: 1.9rem;
51
+ font-size: 1.3rem;
52
+ font-weight: 700;
53
+ letter-spacing: 0.16em;
54
+ text-transform: uppercase;
55
+ color: #6b6a72;
56
+
57
+ @include min(tablet) {
58
+ line-height: 2.4rem;
59
+ font-size: 1.6rem;
60
+ }
61
+ }
62
+
63
+ .socials {
64
+ margin-bottom: 2.4rem;
65
+ }
66
+
67
+ .biography {
68
+ margin-bottom: 2.4rem;
69
+ height: 13.5rem;
70
+ display: -webkit-box;
71
+ -webkit-box-orient: vertical;
72
+ -webkit-line-clamp: 5;
73
+ overflow: hidden;
74
+ text-overflow: ellipsis;
75
+ line-height: 2.7rem;
76
+ font-size: 1.6rem;
77
+ font-weight: 400;
78
+ color: #3e3c47;
79
+
80
+ @include min(tablet) {
81
+ height: 5.4rem;
82
+ -webkit-line-clamp: 2;
83
+ }
84
+
85
+ img {
86
+ display: none;
87
+ }
88
+ }