gatsby-matrix-theme 19.0.1 → 19.0.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.
- package/CHANGELOG.md +16 -0
- package/package.json +2 -2
- package/src/components/atoms/cards/article-card/template-one/article-card.module.scss +39 -81
- package/src/components/atoms/cards/article-card/template-one/index.js +45 -40
- package/src/components/atoms/cards/article-card/template-one/template-one.test.js +11 -6
- package/src/gatsby-core-theme/components/molecules/module/index.js +5 -1
- package/storybook/public/454.1f2ee5a6.iframe.bundle.js +7 -0
- package/storybook/public/{864.0308cf93.iframe.bundle.js.map → 454.1f2ee5a6.iframe.bundle.js.map} +1 -1
- package/storybook/public/94.de8ea949.iframe.bundle.js +1 -0
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.f2438e56.iframe.bundle.js +1 -0
- package/storybook/public/runtime~main.cb33aa33.iframe.bundle.js +1 -0
- package/storybook/public/864.0308cf93.iframe.bundle.js +0 -7
- package/storybook/public/main.3584c0d8.iframe.bundle.js +0 -1
- package/storybook/public/runtime~main.78185c75.iframe.bundle.js +0 -1
- /package/storybook/public/{864.0308cf93.iframe.bundle.js.LICENSE.txt → 454.1f2ee5a6.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [19.0.2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v19.0.1...v19.0.2) (2023-04-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* article styling ([6d7e98d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6d7e98da6da7eda8c1039d7cf7ae3a5d9cc03010))
|
|
7
|
+
* conflicts ([60b9650](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/60b9650b58b61b5ab6e57072c6f8a48da75c76cb))
|
|
8
|
+
* faq display front end matrix ([d379930](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d37993016fa3866e9ad955b3c0accc5f9f09967c))
|
|
9
|
+
* tests ([b78f03e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b78f03e921475209f0af76e5a2919c21d5cf1fb5))
|
|
10
|
+
* tests ([7145589](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7145589aad290e31505ab3a8a8eff5a81f51ba3a))
|
|
11
|
+
* updaet core version ([6bf6788](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6bf6788f12ea33fa4248f0f4418fa12d23e74159))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
* Merge branch 'tm-3311-article-cards' into 'master' ([96cd092](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/96cd092a2d7d0d9ee049465385d5e5c531be1590))
|
|
15
|
+
* Merge branch 'tm-3381-faq-section-matrix' into 'master' ([88a229b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/88a229b815777a3e75d70b27e76755cc03f43aa1))
|
|
16
|
+
|
|
1
17
|
## [19.0.1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v19.0.0...v19.0.1) (2023-04-12)
|
|
2
18
|
|
|
3
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-matrix-theme",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.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": "20.0.
|
|
28
|
+
"gatsby-core-theme": "20.0.1",
|
|
29
29
|
"gatsby-plugin-sharp": "^4.10.2",
|
|
30
30
|
"gatsby-plugin-sitemap": "^3.3.0",
|
|
31
31
|
"gatsby-transformer-sharp": "^4.10.0",
|
|
@@ -28,99 +28,57 @@
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
|
|
32
|
+
.image {
|
|
33
|
+
img {
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
object-fit: cover;
|
|
37
|
+
border-radius: 1.2rem;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.showAuthorOnOneLine {
|
|
33
42
|
@include flex-align(center, space-between);
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
line-height: 22px;
|
|
34
45
|
width: 100%;
|
|
46
|
+
gap: .2rem;
|
|
35
47
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
grid-template-columns: auto 1fr;
|
|
48
|
+
img {
|
|
49
|
+
border-radius: 10rem;
|
|
39
50
|
}
|
|
40
51
|
|
|
41
|
-
> div
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
font-weight: 700 !important;
|
|
49
|
-
}
|
|
50
|
-
> img {
|
|
51
|
-
position: absolute;
|
|
52
|
-
left: -0.6rem;
|
|
53
|
-
max-width: 2.4rem;
|
|
54
|
-
max-height: 2.4rem;
|
|
55
|
-
}
|
|
56
|
-
> span {
|
|
57
|
-
font-size: 1.4rem;
|
|
58
|
-
line-height: 2.2rem;
|
|
59
|
-
color: #3e3c47 !important;
|
|
60
|
-
font-weight: 500;
|
|
61
|
-
}
|
|
62
|
-
> p {
|
|
63
|
-
padding-left: 2.8rem;
|
|
64
|
-
span {
|
|
65
|
-
font-size: 1.4rem;
|
|
66
|
-
color: #3e3c47;
|
|
67
|
-
font-weight: 400;
|
|
68
|
-
line-height: 22px;
|
|
69
|
-
text-transform: capitalize;
|
|
70
|
-
white-space: nowrap;
|
|
71
|
-
}
|
|
52
|
+
> div {
|
|
53
|
+
@include flex-align(flex-start, flex-start);
|
|
54
|
+
gap: .2rem;
|
|
55
|
+
flex-grow: 1;
|
|
56
|
+
>span {
|
|
57
|
+
flex-grow: 1;
|
|
58
|
+
@include flex-align(flex-end, flex-end);
|
|
72
59
|
}
|
|
73
60
|
}
|
|
74
61
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
62
|
+
|
|
63
|
+
.showAuthorBlock {
|
|
64
|
+
@include flex-align(center, flex-start);
|
|
65
|
+
font-size: 14px;
|
|
66
|
+
line-height: 22px;
|
|
67
|
+
width: 100%;
|
|
68
|
+
gap: .5rem;
|
|
69
|
+
|
|
70
|
+
img {
|
|
71
|
+
border-radius: 10rem;
|
|
86
72
|
}
|
|
87
|
-
}
|
|
88
73
|
|
|
89
|
-
.showAuthorOnOneLine {
|
|
90
|
-
position: relative;
|
|
91
74
|
> div {
|
|
92
|
-
@include flex-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
padding-left: 5.6rem;
|
|
96
|
-
a {
|
|
97
|
-
&::before {
|
|
98
|
-
padding: 0 !important;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
> span {
|
|
102
|
-
color: #6b6a72 !important;
|
|
103
|
-
}
|
|
104
|
-
img {
|
|
105
|
-
min-width: 4.8rem;
|
|
106
|
-
min-height: 4.8rem;
|
|
107
|
-
bottom: 0;
|
|
108
|
-
margin: 0 auto;
|
|
109
|
-
object-fit: cover;
|
|
110
|
-
top: -0.25rem;
|
|
111
|
-
}
|
|
112
|
-
p {
|
|
113
|
-
padding-left: 0;
|
|
114
|
-
span {
|
|
115
|
-
display: none;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
75
|
+
@include flex-align(flex-start, flex-start);
|
|
76
|
+
gap: .2rem;
|
|
77
|
+
flex-direction: column;
|
|
120
78
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
79
|
+
>span {
|
|
80
|
+
flex-grow: 1;
|
|
81
|
+
@include flex-align(flex-end, flex-end);
|
|
124
82
|
}
|
|
125
83
|
}
|
|
126
84
|
}
|
|
@@ -1,62 +1,67 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
2
|
/* eslint-disable camelcase */
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useContext } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import Link from 'gatsby-core-theme/src/hooks/link';
|
|
6
|
-
import { imagePrettyUrl,
|
|
6
|
+
import { imagePrettyUrl, translate } from 'gatsby-core-theme/src/helpers/getters';
|
|
7
7
|
import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
8
|
+
import { formatDate } from '~helpers/date-time';
|
|
9
|
+
import { Context } from '~context/MainProvider';
|
|
11
10
|
import styles from './article-card.module.scss';
|
|
12
11
|
|
|
13
|
-
const ArticleCard = ({
|
|
12
|
+
const ArticleCard = ({
|
|
13
|
+
showAuthorOnOneLine = false,
|
|
14
|
+
item,
|
|
15
|
+
width = 360,
|
|
16
|
+
height = 240,
|
|
17
|
+
showDate = true,
|
|
18
|
+
}) => {
|
|
14
19
|
const { author, title, path, banner } = item;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const cardBackgroundImage = getSectionExtraField(null, item, 'card_background_image');
|
|
20
|
-
const featured = !!cardBackgroundImage;
|
|
20
|
+
const { translations } = useContext(Context) || {};
|
|
21
|
+
const imgSize = showAuthorOnOneLine ? 30 : 48;
|
|
22
|
+
const date = item?.updated_at || item?.created_at;
|
|
23
|
+
const formatedDate = date && formatDate(date, 'DD.MM.YYYY', '/', 'en-GB');
|
|
21
24
|
|
|
22
25
|
return (
|
|
23
26
|
<div className={styles.article}>
|
|
24
|
-
{
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
alt={title}
|
|
34
|
-
/>
|
|
35
|
-
)}
|
|
36
|
-
</Link>
|
|
37
|
-
</div>
|
|
27
|
+
{banner && (
|
|
28
|
+
<Link to={path} className={`${styles.image} article-card-gtm`} aria-label={`${title} Link`}>
|
|
29
|
+
<LazyImage
|
|
30
|
+
width={width}
|
|
31
|
+
height={height}
|
|
32
|
+
src={imagePrettyUrl(banner, width, height)}
|
|
33
|
+
alt={title}
|
|
34
|
+
/>
|
|
35
|
+
</Link>
|
|
38
36
|
)}
|
|
39
|
-
<div className={`${styles.cardContent}
|
|
37
|
+
<div className={`${styles.cardContent}`}>
|
|
40
38
|
<Link to={path} className="article-card-gtm">
|
|
41
39
|
<span className={styles.cardTitle}>{title}</span>
|
|
42
40
|
</Link>
|
|
41
|
+
|
|
43
42
|
{typeof author === 'object' && (
|
|
44
43
|
<div
|
|
45
|
-
className={`${
|
|
46
|
-
|
|
47
|
-
}`}
|
|
44
|
+
className={`${
|
|
45
|
+
showAuthorOnOneLine ? styles.showAuthorOnOneLine : styles.showAuthorBlock
|
|
46
|
+
} `}
|
|
48
47
|
>
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
authorImg={author?.image}
|
|
55
|
-
date={showDate ? item?.updated_at || item?.created_at : null}
|
|
56
|
-
link={author?.profile_page_path}
|
|
57
|
-
authorImageHeight={showAuthorOnOneLine ? 48 : 30}
|
|
58
|
-
authorImageWidth={showAuthorOnOneLine ? 48 : 30}
|
|
48
|
+
<LazyImage
|
|
49
|
+
alt={author?.name}
|
|
50
|
+
width={imgSize}
|
|
51
|
+
height={imgSize}
|
|
52
|
+
src={imagePrettyUrl(author?.image, imgSize, imgSize)}
|
|
59
53
|
/>
|
|
54
|
+
<div>
|
|
55
|
+
{showAuthorOnOneLine && (
|
|
56
|
+
<p>
|
|
57
|
+
<span>{translate(translations, 'by', 'By')}</span>
|
|
58
|
+
</p>
|
|
59
|
+
)}
|
|
60
|
+
<Link to={author?.profile_page_path} title={author?.name}>
|
|
61
|
+
{author?.name}
|
|
62
|
+
</Link>
|
|
63
|
+
{showDate && <span className={styles.noLink}>{formatedDate}</span>}
|
|
64
|
+
</div>
|
|
60
65
|
</div>
|
|
61
66
|
)}
|
|
62
67
|
</div>
|
|
@@ -18,28 +18,33 @@ const item = {
|
|
|
18
18
|
|
|
19
19
|
describe('ArticleCard', () => {
|
|
20
20
|
it('render Article Card', () => {
|
|
21
|
-
const {
|
|
21
|
+
const { getByText } = render(
|
|
22
22
|
<ArticleCard item={item} width={200} height={200} showAuthorOnOneLine={false} />
|
|
23
23
|
);
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
expect(getByText('Sample Article')).toBeInTheDocument();
|
|
26
26
|
expect(getByText('John Doe')).toBeInTheDocument();
|
|
27
|
+
expect(getByText('01/02/2022')).toBeInTheDocument();
|
|
27
28
|
});
|
|
28
29
|
|
|
29
30
|
it('should render the article card with author on one line', () => {
|
|
30
|
-
const {
|
|
31
|
+
const { getByText } = render(
|
|
31
32
|
<ArticleCard item={item} width={200} height={200} showAuthorOnOneLine />
|
|
32
33
|
);
|
|
33
|
-
expect(
|
|
34
|
+
expect(getByText('By')).toBeInTheDocument();
|
|
35
|
+
expect(getByText('John Doe')).toBeInTheDocument();
|
|
36
|
+
expect(getByText('01/02/2022')).toBeInTheDocument();
|
|
34
37
|
expect(getByText('Sample Article')).toBeInTheDocument();
|
|
35
38
|
});
|
|
36
39
|
|
|
37
40
|
it('without a banner image', () => {
|
|
38
41
|
const itemWithoutBanner = { ...item, banner: null };
|
|
39
|
-
const {
|
|
42
|
+
const { getByText } = render(
|
|
40
43
|
<ArticleCard item={itemWithoutBanner} width={200} height={200} showAuthorOnOneLine={false} />
|
|
41
44
|
);
|
|
42
|
-
|
|
45
|
+
|
|
46
|
+
expect(getByText('John Doe')).toBeInTheDocument();
|
|
47
|
+
expect(getByText('01/02/2022')).toBeInTheDocument();
|
|
43
48
|
expect(getByText('Sample Article')).toBeInTheDocument();
|
|
44
49
|
});
|
|
45
50
|
|
|
@@ -59,7 +59,11 @@ const Modules = ({ module, page, pageContext, index, exclOperator }) => {
|
|
|
59
59
|
case 'spotlights':
|
|
60
60
|
return loadable(() => import('gatsby-core-theme/src/components/atoms/spotlights'));
|
|
61
61
|
case 'faq':
|
|
62
|
-
|
|
62
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
63
|
+
if (moduleItem?.display_front_end === '1') {
|
|
64
|
+
return loadable(() => import('../../../../components/molecules/faq'));
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
63
67
|
// Template blocks
|
|
64
68
|
case 'horse_racing_calculator':
|
|
65
69
|
return loadable(() => import('../../../../components/molecules/horse-calculator'));
|