gatsby-matrix-theme 17.0.1 → 17.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/package.json +2 -2
- package/src/components/atoms/cards/author/template-one/index.js +56 -0
- package/src/components/atoms/cards/author/template-one/template-one.module.scss +70 -0
- package/src/components/atoms/cards/author/template-one/template-one.stories.js +42 -0
- package/src/components/atoms/cards/author/template-one/template-one.test.js +29 -0
- package/src/components/atoms/cards/author/template-two/index.js +51 -0
- package/src/components/atoms/cards/author/template-two/template-two.module.scss +63 -0
- package/src/components/atoms/cards/author/template-two/template-two.stories.js +42 -0
- package/src/components/atoms/cards/author/template-two/template-two.test.js +27 -0
- package/src/components/atoms/cards/comparison-table/index.js +2 -1
- package/src/components/atoms/feedBackModule/feedback-module.module.scss +126 -0
- package/src/components/atoms/feedBackModule/index.js +98 -0
- package/src/components/molecules/header/variants/author/template-four/index.js +1 -1
- package/src/components/molecules/header/variants/author/template-one/index.js +2 -1
- package/src/components/molecules/header/variants/author/template-three/index.js +1 -1
- package/src/components/molecules/header/variants/author/template-two/index.js +1 -1
- package/src/components/molecules/operator-summary/index.js +3 -1
- package/src/gatsby-core-theme/components/atoms/module-title/index.js +1 -1
- package/src/gatsby-core-theme/components/molecules/header/header.test.js +1 -1
- package/src/gatsby-core-theme/components/molecules/header/index.js +3 -4
- package/src/gatsby-core-theme/components/molecules/main/index.js +4 -2
- package/src/gatsby-core-theme/components/molecules/module/index.js +1 -1
- package/src/gatsby-core-theme/components/organisms/cards/index.js +17 -6
- package/src/gatsby-core-theme/components/organisms/head/index.js +2 -2
- package/src/gatsby-core-theme/components/pages/body/index.js +6 -5
- package/src/gatsby-core-theme/helpers/schema.js +2 -1
- package/storybook/public/{870.09305416.iframe.bundle.js → 870.4fcc5488.iframe.bundle.js} +3 -3
- package/storybook/public/{870.09305416.iframe.bundle.js.map → 870.4fcc5488.iframe.bundle.js.map} +1 -1
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.a08237e2.iframe.bundle.js +1 -0
- package/tests/factories/authors/author.factory.js +1 -0
- package/tests/factories/pages/default.factory.js +1 -1
- package/storybook/public/main.b885f939.iframe.bundle.js +0 -1
- /package/src/components/{molecules/header/variants/author/assets → atoms/author}/socials/index.js +0 -0
- /package/src/components/{molecules/header/variants/author/assets → atoms/author}/socials/socials.module.scss +0 -0
- /package/src/components/atoms/cards/{payment-method-card → payment-method}/sellingPoints/index.js +0 -0
- /package/src/components/atoms/cards/{payment-method-card → payment-method}/sellingPoints/selling-points.module.scss +0 -0
- /package/src/components/atoms/cards/{payment-method-card → payment-method}/sellingPoints/selling-points.test.js +0 -0
- /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-one/index.js +0 -0
- /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-one/template-one.module.scss +0 -0
- /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-one/template-one.stories.js +0 -0
- /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-one/template-one.test.js +0 -0
- /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-three/index.js +0 -0
- /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-three/template-three.module.scss +0 -0
- /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-three/template-three.stories.js +0 -0
- /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-three/template-three.test.js +0 -0
- /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-two/index.js +0 -0
- /package/src/components/atoms/cards/{payment-method-card → payment-method}/template-two/template-two.stories.js +0 -0
- /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,40 @@
|
|
|
1
|
+
## [17.1.1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v17.1.0...v17.1.1) (2023-03-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* added author card templates ([a8d4a45](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a8d4a451f3f4dc9a88ae9d25ff06ac92c52b4bd3))
|
|
7
|
+
* added author cards ([4ec39da](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4ec39dad041fdcab2baf0228019dfe1783533bec))
|
|
8
|
+
* change page type to relation_type ([b535e0f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b535e0fda43ef5396d340562e20cf506fb3ee708))
|
|
9
|
+
* conflict ([4a1f6b4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4a1f6b45b3a345dff627f7d9c265c88515389e22))
|
|
10
|
+
* remove console.log and update if else ([cc3c224](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/cc3c2242bd7703c3cd4c0c979b6458edae9bb8c6))
|
|
11
|
+
* update core version ([e516ad6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e516ad696b1422289d6e5d3a17c23d0a78bf73d3))
|
|
12
|
+
* update to the latest core version ([484a4de](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/484a4defd5886e569bbdcfc58ed89442990d7e27))
|
|
13
|
+
* update with the latest change ([71a9d0b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/71a9d0b0a1181009c3a6e7fa0dc25405b889f252))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
* Merge branch 'tm-3312-author-cards' into 'master' ([3a436d0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/3a436d0f817f04593539cf9edd79ce398b7fa7fd))
|
|
17
|
+
* Merge branch 'tm-3088-have-you-found-feature' into 'master' ([ecbc01b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ecbc01bf80e3f5be63c679557fbe6941757d9676))
|
|
18
|
+
* Merge branch 'tm-3324-change-type' into 'master' ([ed96781](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ed96781f772b083fac0509a4fd704e3f21464404))
|
|
19
|
+
* Merge branch 'master' into tm-3312-author-cards ([a7dccdf](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a7dccdfb44b2311142e0c171c4855e27e60187e5))
|
|
20
|
+
|
|
21
|
+
# [17.1.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v17.0.1...v17.1.0) (2023-03-29)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* update _main and feedback scss ([281192b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/281192b0491e7f60d30ab4e6adc0a41df1e3d1ba))
|
|
27
|
+
* update styling for feedback module ([eb7abc6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/eb7abc6acd37751ed306df0c7cfd12c619827e0c))
|
|
28
|
+
* update styling for feedback module ([e732cb1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e732cb18e3a1e70f1981d6ca70c0b09d3b8fd80c))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
* Merge branch 'tm-3088-have-you-found-feature' into 'master' ([4cbdb00](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4cbdb00d8ae13de99e6c42b6c6d7281d6f5c7da5))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* add the have you found what you have been looking for feature ([305fbb4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/305fbb4eb8c0293a3be5846dbaf2ecb9046cd472))
|
|
37
|
+
|
|
1
38
|
## [17.0.1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v17.0.0...v17.0.1) (2023-03-28)
|
|
2
39
|
|
|
3
40
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-matrix-theme",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.1.1",
|
|
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.
|
|
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 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,70 @@
|
|
|
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: 2rem;
|
|
12
|
+
border-radius: 4rem;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
> a {
|
|
16
|
+
@include flex-align(flex-end, flex-start);
|
|
17
|
+
flex-grow: 1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.posts {
|
|
22
|
+
position: absolute;
|
|
23
|
+
background: #5545a9;
|
|
24
|
+
border-radius: 100px;
|
|
25
|
+
color: #fff;
|
|
26
|
+
top: 2.4rem;
|
|
27
|
+
right: 2.4rem;
|
|
28
|
+
letter-spacing: 0.5px;
|
|
29
|
+
text-transform: uppercase;
|
|
30
|
+
font-weight: 700;
|
|
31
|
+
font-size: 10px;
|
|
32
|
+
line-height: 13px;
|
|
33
|
+
padding: 0.6rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.title {
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
font-size: 13px;
|
|
39
|
+
line-height: 19px;
|
|
40
|
+
letter-spacing: 0.16em;
|
|
41
|
+
text-transform: uppercase;
|
|
42
|
+
color: #737090;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.name {
|
|
46
|
+
color: #000;
|
|
47
|
+
font-weight: 700;
|
|
48
|
+
font-size: 20px;
|
|
49
|
+
margin-bottom: 2rem;
|
|
50
|
+
line-height: 30px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.bio {
|
|
54
|
+
font-size: 16px;
|
|
55
|
+
line-height: 27px;
|
|
56
|
+
margin-top: 2rem;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.readMore {
|
|
60
|
+
font-weight: 700;
|
|
61
|
+
font-size: 14px;
|
|
62
|
+
line-height: 18px;
|
|
63
|
+
color: #1c1a28;
|
|
64
|
+
margin-top: 1rem;
|
|
65
|
+
|
|
66
|
+
svg {
|
|
67
|
+
margin-left: .8rem;
|
|
68
|
+
margin-bottom: .1rem;
|
|
69
|
+
}
|
|
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 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 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,63 @@
|
|
|
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
|
+
.title {
|
|
31
|
+
font-weight: 700;
|
|
32
|
+
font-size: 13px;
|
|
33
|
+
line-height: 19px;
|
|
34
|
+
letter-spacing: 0.16em;
|
|
35
|
+
text-transform: uppercase;
|
|
36
|
+
color: #737090;
|
|
37
|
+
text-align: center;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.nameContainer {
|
|
41
|
+
@include flex-align(center, center);
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.name {
|
|
46
|
+
color: #000;
|
|
47
|
+
font-weight: 700;
|
|
48
|
+
font-size: 20px;
|
|
49
|
+
line-height: 30px;
|
|
50
|
+
position: relative;
|
|
51
|
+
|
|
52
|
+
&:after {
|
|
53
|
+
@include arrow(var(--horse-calc-label-color, #000), 0.8rem, down, false);
|
|
54
|
+
position: absolute;
|
|
55
|
+
right: -1.5rem;
|
|
56
|
+
top: 38%;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.bio {
|
|
61
|
+
font-size: 16px;
|
|
62
|
+
line-height: 27px;
|
|
63
|
+
}
|
|
@@ -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?.
|
|
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
|
}),
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
.mainContainer {
|
|
2
|
+
padding: 0 2.4rem;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.dottedBorder {
|
|
6
|
+
border: var(--feedbackModule-main-border);
|
|
7
|
+
border-radius: var(--feedbackModule-main-border-radius);
|
|
8
|
+
width: auto !important;
|
|
9
|
+
max-width: var(--main-container-max) !important;
|
|
10
|
+
margin-bottom: 1rem !important;
|
|
11
|
+
margin: 0 auto;
|
|
12
|
+
padding: 1.6rem;
|
|
13
|
+
}
|
|
14
|
+
.container {
|
|
15
|
+
@include flex-align(center, space-between);
|
|
16
|
+
border: var(--feedbackModule-container-border);
|
|
17
|
+
background: var(--feedbackModule-background-color);
|
|
18
|
+
border-radius: var(--feedbackModule-container-radius);
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
padding: 24px 16px;
|
|
21
|
+
gap: var(--feedbackModule-container-gap-mobile);
|
|
22
|
+
}
|
|
23
|
+
.textContainer {
|
|
24
|
+
@include flex-direction(column);
|
|
25
|
+
gap: 8px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.firstText {
|
|
29
|
+
font-weight: 700;
|
|
30
|
+
font-size: var(--feedbackModule-firstText-font-size-mobile);
|
|
31
|
+
line-height: var(--feedbackModule-firstText-line-height-mobile);
|
|
32
|
+
color: var(--color-71);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.secondText {
|
|
36
|
+
font-weight: 500;
|
|
37
|
+
font-size: 16px;
|
|
38
|
+
line-height: var(--feedbackModule-secondText-line-height);
|
|
39
|
+
color: var(--color-72);
|
|
40
|
+
> a {
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
font-size: 16px;
|
|
43
|
+
line-height: var(--feedbackModule-secondText-anchor-line-height);
|
|
44
|
+
color: var(--color-73);
|
|
45
|
+
>svg {
|
|
46
|
+
display: none
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
.buttonContainer {
|
|
51
|
+
@include flex-direction(row);
|
|
52
|
+
width: 100%;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
gap: 8px;
|
|
55
|
+
|
|
56
|
+
> :first-child,
|
|
57
|
+
> :last-child {
|
|
58
|
+
padding: 16px 24px;
|
|
59
|
+
border: var(--feedbackModule-buttons-border-style);
|
|
60
|
+
border-radius: var(--feedbackModule-buttons-border-radius);
|
|
61
|
+
font-weight: 700;
|
|
62
|
+
width: var(--feedbackModule-buttons-width-mobile);
|
|
63
|
+
font-size: var(--feedbackModule-buttons-font-size);
|
|
64
|
+
line-height: var(--feedbackModule-buttons-line-height);
|
|
65
|
+
color: var(--color-74);
|
|
66
|
+
height: var(--feedbackModule-buttons-height-mobile);
|
|
67
|
+
@include flex-align(center, center);
|
|
68
|
+
background: var(--feedbackModule-buttons-background);
|
|
69
|
+
letter-spacing: var(--feedbackModule-buttons-letter-spacing);
|
|
70
|
+
> svg {
|
|
71
|
+
display: none;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
:first-child {
|
|
75
|
+
box-shadow: var(--feedbackModule-first-button-box-shadow);
|
|
76
|
+
background: var(--feedback-first-button-background);
|
|
77
|
+
}
|
|
78
|
+
> :last-child {
|
|
79
|
+
box-shadow: var(--feedbackModule-second-button-box-shadow);
|
|
80
|
+
background: var(--feedback-second-button-background);
|
|
81
|
+
}
|
|
82
|
+
> :first-child:hover {
|
|
83
|
+
background-color: var(--color-75);
|
|
84
|
+
border: var(--feedbackModule-first-button-border);
|
|
85
|
+
box-shadow: var(--feedback-first-button-box-shadow-hover);
|
|
86
|
+
}
|
|
87
|
+
> :last-child:hover {
|
|
88
|
+
background-color: var(--color-76);
|
|
89
|
+
border: var(--feedbackModule-second-button-border);
|
|
90
|
+
box-shadow: var(--feedback-second-button-box-shadow-hover);
|
|
91
|
+
}
|
|
92
|
+
.onlyDesktop {
|
|
93
|
+
display: none;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@include min(tablet) {
|
|
98
|
+
.dottedBorder {
|
|
99
|
+
max-width: calc(var(--main-container-max) - 48px) !important;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.container {
|
|
103
|
+
flex-direction: row;
|
|
104
|
+
padding: 24px;
|
|
105
|
+
gap: var(--feedbackModule-container-gap);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.firstText {
|
|
109
|
+
font-size: var(--feedbackModule-firstText-font-size);
|
|
110
|
+
line-height: var(--feedbackModule-firstText-line-height);
|
|
111
|
+
}
|
|
112
|
+
.onlyDesktop {
|
|
113
|
+
display: block;
|
|
114
|
+
}
|
|
115
|
+
.textContainer {
|
|
116
|
+
gap: 4px;
|
|
117
|
+
}
|
|
118
|
+
.buttonContainer {
|
|
119
|
+
width: auto;
|
|
120
|
+
> :first-child,
|
|
121
|
+
> :last-child {
|
|
122
|
+
width: var(--feedbackModule-buttons-width);
|
|
123
|
+
height: var(--feedbackModule-buttons-height);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React, { useContext, useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Button from 'gatsby-core-theme/src/components/atoms/button';
|
|
4
|
+
import { translate } from 'gatsby-core-theme/src/helpers/getters';
|
|
5
|
+
import { Context } from 'gatsby-core-theme/src/context/MainProvider';
|
|
6
|
+
import styles from './feedback-module.module.scss';
|
|
7
|
+
|
|
8
|
+
const FeedBackModule = ({ path = 'contact-us' }) => {
|
|
9
|
+
const { translations } = useContext(Context);
|
|
10
|
+
const [response, setResponse] = useState(null);
|
|
11
|
+
|
|
12
|
+
const handleClick = (userResponse) => {
|
|
13
|
+
setResponse(userResponse);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className={styles.mainContainer}>
|
|
18
|
+
<div className={styles.dottedBorder}>
|
|
19
|
+
<div className={styles.container}>
|
|
20
|
+
<div className={styles.textContainer}>
|
|
21
|
+
{!response && (
|
|
22
|
+
<p className={styles.firstText}>{`${translate(
|
|
23
|
+
translations,
|
|
24
|
+
'have_you_found_text',
|
|
25
|
+
"Have You Found What You're Looking for?"
|
|
26
|
+
)}`}</p>
|
|
27
|
+
)}
|
|
28
|
+
{!response && (
|
|
29
|
+
<p className={`${styles.secondText} ${styles.onlyDesktop}`}>{`${translate(
|
|
30
|
+
translations,
|
|
31
|
+
'feedback_text',
|
|
32
|
+
'Your feedback is paramount!'
|
|
33
|
+
)}`}</p>
|
|
34
|
+
)}
|
|
35
|
+
|
|
36
|
+
{response === 'yes' && (
|
|
37
|
+
<p className={styles.firstText}>{`${translate(
|
|
38
|
+
translations,
|
|
39
|
+
'yes_first_text',
|
|
40
|
+
'Glad To hear that! 😊'
|
|
41
|
+
)}`}</p>
|
|
42
|
+
)}
|
|
43
|
+
|
|
44
|
+
{response === 'yes' && (
|
|
45
|
+
<p className={styles.secondText}>
|
|
46
|
+
{`${translate(
|
|
47
|
+
translations,
|
|
48
|
+
'yes_second_text',
|
|
49
|
+
'Tell us more about what you liked best. Send us a message'
|
|
50
|
+
)}`}{' '}
|
|
51
|
+
<Button btnText="here" noStyle to={path} />
|
|
52
|
+
</p>
|
|
53
|
+
)}
|
|
54
|
+
|
|
55
|
+
{response === 'no' && (
|
|
56
|
+
<p className={styles.firstText}>{`${translate(
|
|
57
|
+
translations,
|
|
58
|
+
'no_first_text',
|
|
59
|
+
'Sorry to hear about that! 😢'
|
|
60
|
+
)}`}</p>
|
|
61
|
+
)}
|
|
62
|
+
|
|
63
|
+
{response === 'no' && (
|
|
64
|
+
<p className={styles.secondText}>
|
|
65
|
+
{`${translate(
|
|
66
|
+
translations,
|
|
67
|
+
'no_second_text',
|
|
68
|
+
'Tell us what you need to know on this topic'
|
|
69
|
+
)}`}{' '}
|
|
70
|
+
<Button btnText="here" noStyle to={path} />
|
|
71
|
+
</p>
|
|
72
|
+
)}
|
|
73
|
+
</div>
|
|
74
|
+
<div className={styles.buttonContainer}>
|
|
75
|
+
<Button
|
|
76
|
+
isButton
|
|
77
|
+
noStyle
|
|
78
|
+
btnText={`${translate(translations, 'yes_button', 'Yes')}`}
|
|
79
|
+
onClick={() => handleClick('yes')}
|
|
80
|
+
/>
|
|
81
|
+
<Button
|
|
82
|
+
isButton
|
|
83
|
+
noStyle
|
|
84
|
+
btnText={`${translate(translations, 'no_button', 'No')}`}
|
|
85
|
+
onClick={() => handleClick('no')}
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
FeedBackModule.propTypes = {
|
|
95
|
+
path: PropTypes.string,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export default FeedBackModule;
|