gatsby-matrix-theme 17.0.1 → 17.1.0

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 CHANGED
@@ -1,3 +1,20 @@
1
+ # [17.1.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v17.0.1...v17.1.0) (2023-03-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update _main and feedback scss ([281192b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/281192b0491e7f60d30ab4e6adc0a41df1e3d1ba))
7
+ * update styling for feedback module ([eb7abc6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/eb7abc6acd37751ed306df0c7cfd12c619827e0c))
8
+ * update styling for feedback module ([e732cb1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e732cb18e3a1e70f1981d6ca70c0b09d3b8fd80c))
9
+
10
+
11
+ * Merge branch 'tm-3088-have-you-found-feature' into 'master' ([4cbdb00](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4cbdb00d8ae13de99e6c42b6c6d7281d6f5c7da5))
12
+
13
+
14
+ ### Features
15
+
16
+ * add the have you found what you have been looking for feature ([305fbb4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/305fbb4eb8c0293a3be5846dbaf2ecb9046cd472))
17
+
1
18
  ## [17.0.1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v17.0.0...v17.0.1) (2023-03-28)
2
19
 
3
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "17.0.1",
3
+ "version": "17.1.0",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -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;
@@ -10,6 +10,7 @@ import Module from 'gatsby-core-theme/src/components/molecules/module';
10
10
  import styles from 'gatsby-core-theme/src/components/molecules/main/main.module.scss';
11
11
  import keygen from 'gatsby-core-theme/src/helpers/keygen';
12
12
  import settings from '../../../../constants/settings/newsletter';
13
+ import FeedBackModule from '../../../../components/atoms/feedBackModule';
13
14
 
14
15
  const Main = ({ section = {}, pageContext = {}, showAuthor = true, exclOperator = false }) => {
15
16
  const { page } = pageContext;
@@ -112,6 +113,7 @@ const Main = ({ section = {}, pageContext = {}, showAuthor = true, exclOperator
112
113
  src="https://a.omappapi.com/app/js/api.min.js"
113
114
  />
114
115
  )}
116
+ <FeedBackModule />
115
117
  </main>
116
118
  );
117
119
  };