gatsby-matrix-theme 5.0.5 → 5.0.8
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/.ci.yml +7 -3
- package/CHANGELOG.md +41 -0
- package/package.json +2 -2
- package/src/components/atoms/cards/popup-card/index.js +10 -4
- package/src/components/atoms/cards/popup-card/popup-card.module.scss +8 -1
- package/src/components/organisms/popup/index.js +16 -10
- package/src/components/organisms/popup/popup.module.scss +1 -1
- package/src/gatsby-core-theme/components/atoms/spotlights/spotlights-theme.module.scss +2 -13
- package/storybook/public/{0.71431a30.iframe.bundle.js → 0.6cfc4d94.iframe.bundle.js} +1 -1
- package/storybook/public/{5.e2943b9c.iframe.bundle.js → 5.6e16d403.iframe.bundle.js} +3 -3
- package/storybook/public/{5.e2943b9c.iframe.bundle.js.LICENSE.txt → 5.6e16d403.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook/public/5.6e16d403.iframe.bundle.js.map +1 -0
- package/storybook/public/{6.d4cc1530.iframe.bundle.js → 6.6ccf906e.iframe.bundle.js} +1 -1
- package/storybook/public/{7.976ee0f8.iframe.bundle.js → 7.2d825c7c.iframe.bundle.js} +1 -1
- package/storybook/public/{9.cdca991d.iframe.bundle.js → 9.f600359d.iframe.bundle.js} +3 -3
- package/storybook/public/{9.cdca991d.iframe.bundle.js.LICENSE.txt → 9.f600359d.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook/public/9.f600359d.iframe.bundle.js.map +1 -0
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.60f25782.iframe.bundle.js +1 -0
- package/storybook/public/{runtime~main.57e18f63.iframe.bundle.js → runtime~main.35ce2f7e.iframe.bundle.js} +1 -1
- package/storybook/public/{vendors~main.f44ae4bf.iframe.bundle.js → vendors~main.0dce1627.iframe.bundle.js} +3 -3
- package/storybook/public/{vendors~main.f44ae4bf.iframe.bundle.js.LICENSE.txt → vendors~main.0dce1627.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook/public/vendors~main.0dce1627.iframe.bundle.js.map +1 -0
- package/storybook/public/5.e2943b9c.iframe.bundle.js.map +0 -1
- package/storybook/public/9.cdca991d.iframe.bundle.js.map +0 -1
- package/storybook/public/main.c5b7073f.iframe.bundle.js +0 -1
- package/storybook/public/vendors~main.f44ae4bf.iframe.bundle.js.map +0 -1
package/.ci.yml
CHANGED
|
@@ -16,9 +16,14 @@ Matrix Theme Test:
|
|
|
16
16
|
- yarn config set cache-folder .yarn
|
|
17
17
|
- yarn
|
|
18
18
|
- yarn workspace gatsby-matrix-theme test
|
|
19
|
+
artifacts:
|
|
20
|
+
paths:
|
|
21
|
+
- coverage/
|
|
19
22
|
coverage: /All files\s*\|\s*([\d\.]+)/
|
|
20
23
|
rules:
|
|
21
24
|
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
|
|
25
|
+
- if: '$CI_COMMIT_BRANCH == "master" && $PIPELINE == "automated"'
|
|
26
|
+
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $PIPELINE == "automated"'
|
|
22
27
|
|
|
23
28
|
Theme Publish:
|
|
24
29
|
image: git.ilcd.rocks:4567/team-floyd/themes/gatsby-themes:node14
|
|
@@ -36,8 +41,7 @@ Theme Publish:
|
|
|
36
41
|
- cd matrix-theme/
|
|
37
42
|
- yarn
|
|
38
43
|
- npx semantic-release -b $CI_COMMIT_REF_NAME
|
|
39
|
-
when:
|
|
40
|
-
manual
|
|
44
|
+
when: manual
|
|
41
45
|
only:
|
|
42
46
|
refs:
|
|
43
47
|
- master
|
|
@@ -45,4 +49,4 @@ Theme Publish:
|
|
|
45
49
|
- $PIPELINE != "content-trigger"
|
|
46
50
|
|
|
47
51
|
variables:
|
|
48
|
-
PIPELINE: automated
|
|
52
|
+
PIPELINE: automated
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
## [5.0.8](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v5.0.7...v5.0.8) (2022-03-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add variable in env file for expire time to popup ([603fa13](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/603fa13e7a56ef2a2213bcd453ab70bedb17ce27))
|
|
7
|
+
* lighthouse order ([38196ff](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/38196ff593eea4877ff71613d641858ea646ba84))
|
|
8
|
+
* popup idle time load ([0affc3e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0affc3ea6172f7191754116da7663edfa0604ce5))
|
|
9
|
+
* popup idle time load ([fea3d62](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fea3d62224a63a7d0ce2c5b2c88054b798283b96))
|
|
10
|
+
* popup idle time load ([9fc819c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9fc819c2d4ac1121afa1918e625c31a9840c52c6))
|
|
11
|
+
* spotlight module styling ([a957a73](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a957a739f7f8c218d26aed8cff4b97272159b8f3))
|
|
12
|
+
* spotlight module styling ([0440670](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/044067018d9f5c6bf1af35115ffe5ecd8b761e99))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
* Merge branch 'tm-2692-popup-fix' into 'master' ([d7931e5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d7931e5e8bebc214ce19c6ebf4c3a118f52c733f))
|
|
16
|
+
* Merge branch 'master' into 'tm-2692-popup-fix' ([cb3e51d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/cb3e51d851e775524c0beb2ba8a193681d1c6c56))
|
|
17
|
+
* Merge branch 'tm-2777-fix-expire-time-popup' into 'master' ([2c5851d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/2c5851db7350a4dad72f5969e07d1d6302bd33d0))
|
|
18
|
+
* Merge branch 'fix-ligthouse-order' into 'master' ([4a1a1e1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4a1a1e148bfab3681cabc435aa454f21c9cb19ae))
|
|
19
|
+
|
|
20
|
+
## [5.0.7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v5.0.6...v5.0.7) (2022-03-10)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* update theme version ([93021b7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/93021b744577e5b0bb0980368219539b2f82fbf5))
|
|
26
|
+
|
|
27
|
+
## [5.0.6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v5.0.5...v5.0.6) (2022-03-10)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* lighthouse pipeline ([e4086ba](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e4086ba67d73a1bab6c0c32eaadfceecd438a8f5))
|
|
33
|
+
* popup styling ([d8533b2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d8533b2661f71abe80177b0d7357f585213106a0))
|
|
34
|
+
* spotlight boxes with icons = style ([ba7914a](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ba7914a4558401350ebe0934d87acc70ad017d7d))
|
|
35
|
+
* spotlight styling ([c852440](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/c852440d4b902ff2a08ce8b7941737a7f7085e68))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
* Merge branch 'tm-2758-lighthouse' into 'master' ([8d1cc38](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8d1cc3824e067a3c55b8f9c8dcc85c5eee381350))
|
|
39
|
+
* Merge branch 'master' of https://git.ilcd.rocks/team-floyd/themes/matrix-theme ([1fea267](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/1fea267f3b6a02b5d78a7d1cea1af91cee4866b9))
|
|
40
|
+
* Merge branch 'tm-2767-fix-boxes-icons' into 'master' ([e7a573e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e7a573edbabbe9047699782c58789f2b340413f1))
|
|
41
|
+
|
|
1
42
|
## [5.0.5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v5.0.4...v5.0.5) (2022-03-09)
|
|
2
43
|
|
|
3
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-matrix-theme",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.8",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "Matrix Theme NPM Package",
|
|
6
6
|
"author": "",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"cross-env": "^7.0.2",
|
|
32
32
|
"dotenv": "8.2.0",
|
|
33
33
|
"gatsby": "^3.3.1",
|
|
34
|
-
"gatsby-core-theme": "^5.1.
|
|
34
|
+
"gatsby-core-theme": "^5.1.2",
|
|
35
35
|
"gatsby-image": "^3.3.0",
|
|
36
36
|
"gatsby-plugin-image": "^1.3.1",
|
|
37
37
|
"gatsby-plugin-postcss": "^4.3.0",
|
|
@@ -3,11 +3,12 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import OperatorCta from 'gatsby-core-theme/src/components/atoms/operator-cta';
|
|
4
4
|
import { imagePrettyUrl } from 'gatsby-core-theme/src/helpers/getters';
|
|
5
5
|
import Tnc from 'gatsby-core-theme/src/components/molecules/tnc';
|
|
6
|
+
import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating';
|
|
6
7
|
import LazyImage from '~hooks/lazy-image';
|
|
7
8
|
|
|
8
9
|
import styles from './popup-card.module.scss';
|
|
9
10
|
|
|
10
|
-
const PopupCard = ({ item, tracker, showName = false, showTnc = false }) => {
|
|
11
|
+
const PopupCard = ({ item, tracker, showName = false, showTnc = false, showRating = false }) => {
|
|
11
12
|
const { logo_url: logoUrl, name } = item;
|
|
12
13
|
const oneLiner = item?.one_liners?.main?.one_liner;
|
|
13
14
|
const secondLiner = item?.one_liners?.secondary?.one_liner;
|
|
@@ -21,6 +22,7 @@ const PopupCard = ({ item, tracker, showName = false, showTnc = false }) => {
|
|
|
21
22
|
<div className={styles.popupCard}>
|
|
22
23
|
<div className={styles.imgContainer}>
|
|
23
24
|
<LazyImage src={imagePrettyUrl(logoUrl)} alt={oneLiner} width={98} height={98} />
|
|
25
|
+
{showRating && <StarRating numOfStars={5} rating={item?.rating} />}
|
|
24
26
|
{showName && <p className={styles.name}>{name}</p>}
|
|
25
27
|
</div>
|
|
26
28
|
<div className={styles.textContainer}>
|
|
@@ -35,9 +37,11 @@ const PopupCard = ({ item, tracker, showName = false, showTnc = false }) => {
|
|
|
35
37
|
gtmClass="popup-operator-cta-gtm"
|
|
36
38
|
/>
|
|
37
39
|
</div>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
{showTnc && tnc === '1' && (
|
|
41
|
+
<div className={styles.tandc}>
|
|
42
|
+
<Tnc onlyMobile operator={item} />
|
|
43
|
+
</div>
|
|
44
|
+
)}
|
|
41
45
|
</div>
|
|
42
46
|
);
|
|
43
47
|
};
|
|
@@ -48,6 +52,7 @@ PopupCard.propTypes = {
|
|
|
48
52
|
links: PropTypes.shape({
|
|
49
53
|
main: PropTypes.string,
|
|
50
54
|
}),
|
|
55
|
+
rating: PropTypes.string,
|
|
51
56
|
extra_fields: PropTypes.shape({
|
|
52
57
|
terms_and_conditions_text_enabled: PropTypes.string,
|
|
53
58
|
}),
|
|
@@ -64,6 +69,7 @@ PopupCard.propTypes = {
|
|
|
64
69
|
tracker: PropTypes.string,
|
|
65
70
|
showName: PropTypes.bool,
|
|
66
71
|
showTnc: PropTypes.bool,
|
|
72
|
+
showRating: PropTypes.bool,
|
|
67
73
|
};
|
|
68
74
|
|
|
69
75
|
export default PopupCard;
|
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
|
|
16
16
|
.imgContainer {
|
|
17
17
|
width: 8rem;
|
|
18
|
-
height: 8rem;
|
|
19
18
|
min-width: 8rem;
|
|
20
19
|
grid-column: 1/2;
|
|
21
20
|
grid-row: 1/2;
|
|
21
|
+
@include flex-direction(column);
|
|
22
|
+
@include flex-align(center, center);
|
|
22
23
|
|
|
23
24
|
@include min(tablet) {
|
|
24
25
|
min-width: 9.8rem;
|
|
@@ -33,6 +34,11 @@
|
|
|
33
34
|
object-fit: contain;
|
|
34
35
|
}
|
|
35
36
|
}
|
|
37
|
+
.tandc{
|
|
38
|
+
grid-row: 3/4;
|
|
39
|
+
grid-column: 1/3;
|
|
40
|
+
margin-bottom: 2rem;
|
|
41
|
+
}
|
|
36
42
|
.textContainer {
|
|
37
43
|
display: flex;
|
|
38
44
|
flex-direction: column;
|
|
@@ -64,6 +70,7 @@
|
|
|
64
70
|
font-size: 1.8rem;
|
|
65
71
|
}
|
|
66
72
|
}
|
|
73
|
+
|
|
67
74
|
}
|
|
68
75
|
.buttonContainer {
|
|
69
76
|
margin-left: 3rem;
|
|
@@ -19,6 +19,7 @@ import styles from './popup.module.scss';
|
|
|
19
19
|
const Popup = ({ module, isStorybook = false, toggle = false, icon = null }) => {
|
|
20
20
|
const modal = useRef(null);
|
|
21
21
|
const [showModal, setShowModal] = useState(false);
|
|
22
|
+
const [isIdle, setIsIdle] = useState(false);
|
|
22
23
|
const { items } = module.items[0];
|
|
23
24
|
const shownItems = items?.slice(0, 4) || [];
|
|
24
25
|
const { style } = module;
|
|
@@ -36,14 +37,10 @@ const Popup = ({ module, isStorybook = false, toggle = false, icon = null }) =>
|
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
const idleTimeout = () => {
|
|
39
|
-
|
|
40
|
-
if (!popupExists) {
|
|
41
|
-
setShowModal(true);
|
|
42
|
-
sessionStorage.setItem('popstate', true);
|
|
43
|
-
}
|
|
40
|
+
setIsIdle(true);
|
|
44
41
|
};
|
|
45
42
|
|
|
46
|
-
const
|
|
43
|
+
const displayModal = () => {
|
|
47
44
|
const popupExists = sessionStorage.getItem('popstate');
|
|
48
45
|
if (!popupExists) {
|
|
49
46
|
setShowModal(true);
|
|
@@ -63,6 +60,12 @@ const Popup = ({ module, isStorybook = false, toggle = false, icon = null }) =>
|
|
|
63
60
|
}
|
|
64
61
|
};
|
|
65
62
|
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (isIdle) {
|
|
65
|
+
window.addEventListener('scroll', displayModal);
|
|
66
|
+
}
|
|
67
|
+
}, [isIdle]);
|
|
68
|
+
|
|
66
69
|
useEffect(() => {
|
|
67
70
|
if (showModal) {
|
|
68
71
|
modal.current.classList.toggle(styles.activeModal);
|
|
@@ -75,18 +78,21 @@ const Popup = ({ module, isStorybook = false, toggle = false, icon = null }) =>
|
|
|
75
78
|
// Close on outside click
|
|
76
79
|
// Show Popup on Idle and on window leave
|
|
77
80
|
useEffect(() => {
|
|
78
|
-
const
|
|
79
|
-
|
|
81
|
+
const time = process.env.EXPIRE_SECONDS_POPUP;
|
|
82
|
+
const expireSeconds = typeof time !== 'undefined' ? time : 20;
|
|
83
|
+
|
|
80
84
|
isStorybook && setShowModal(true);
|
|
81
85
|
window.addEventListener('keydown', handleEsc);
|
|
82
86
|
window.addEventListener('mousedown', handleOutsideClick);
|
|
83
|
-
|
|
87
|
+
window.addEventListener('load', setIdleTimeout(expireSeconds, idleTimeout));
|
|
88
|
+
document.addEventListener('mouseleave', displayModal);
|
|
84
89
|
|
|
85
90
|
// Clean up event listeners after popup is closed
|
|
86
91
|
return () => {
|
|
87
92
|
window.removeEventListener('keydown', handleEsc);
|
|
88
93
|
window.removeEventListener('mousedown', handleOutsideClick);
|
|
89
|
-
|
|
94
|
+
window.removeEventListener('load', setIdleTimeout);
|
|
95
|
+
document.removeEventListener('mouseleave', displayModal);
|
|
90
96
|
};
|
|
91
97
|
}, []);
|
|
92
98
|
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
ul {
|
|
46
46
|
display: flex;
|
|
47
47
|
flex-direction: column;
|
|
48
|
+
align-items: flex-end;
|
|
48
49
|
|
|
49
50
|
li {
|
|
50
51
|
border: 1px solid var(--spotlight-boxes-border-color);
|
|
@@ -52,13 +53,12 @@
|
|
|
52
53
|
box-sizing: border-box;
|
|
53
54
|
border-radius: var(--spotlight-boxes-border-radius);
|
|
54
55
|
position: relative;
|
|
55
|
-
max-width: 568px;
|
|
56
|
-
margin-left: 4.5rem;
|
|
57
56
|
margin-bottom: 3rem;
|
|
58
57
|
padding: 2.4rem 2.4rem 2.8rem 7.2rem;
|
|
59
58
|
min-height: 15rem;
|
|
60
59
|
text-align: left;
|
|
61
60
|
justify-content: center;
|
|
61
|
+
width: calc(100% - 4.5rem);
|
|
62
62
|
|
|
63
63
|
> a > img, > img {
|
|
64
64
|
position: absolute;
|
|
@@ -77,10 +77,6 @@
|
|
|
77
77
|
margin-top: 3rem;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
@include max(mobile) {
|
|
81
|
-
width: auto;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
80
|
> label {
|
|
85
81
|
font-size: var(--spotlight-boxes-label-size);
|
|
86
82
|
color: var(--spotlight-boxes-label-color);
|
|
@@ -93,12 +89,5 @@
|
|
|
93
89
|
color: var(--spotlight-boxes-text-color);
|
|
94
90
|
}
|
|
95
91
|
}
|
|
96
|
-
|
|
97
|
-
li:nth-child(2n) {
|
|
98
|
-
margin-left: auto;
|
|
99
|
-
@include max(mobile) {
|
|
100
|
-
margin-left: 4.5rem;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
92
|
}
|
|
104
93
|
}
|