gatsby-matrix-theme 7.1.58 → 7.1.60

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,40 @@
1
+ ## [7.1.60](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v7.1.59...v7.1.60) (2022-09-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add colors variable and finish the logic ([adc0675](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/adc0675b18b6510ac62f1d4541576441b1a11727))
7
+ * add recommend module ([582f052](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/582f052fdc98beca3775354108dd3d95e97cff27))
8
+ * add translates key ([c9add58](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/c9add58d24d08c36cfc9492a65c0bc0809c68250))
9
+ * fix a bug ([3b01993](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/3b01993f0b0dde7c2fab6cec970d266dbe5257d4))
10
+ * make style ([3f0f144](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/3f0f1445683a1d6e66c74be4fe459e02d650cb45))
11
+ * test api ([c2dff0e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/c2dff0ec2e39ddc49c2642d9da0a1bd190641c48))
12
+ * update endpoint ([e38528d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e38528dd179dd272c7fe5b507ccdd98185a38211))
13
+ * update my branch from master ([7781568](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7781568f3334fc3cea4bc951f4bc8f332f75155e))
14
+ * use feedbackCounter label ([7351d3b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7351d3b6f4e67526fad569f58049b3db470c4f47))
15
+
16
+
17
+ ### Config
18
+
19
+ * update core theme with lates version ([c962b1c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/c962b1c36dbbba4be72e506563f599e16aee4e00))
20
+
21
+
22
+ * Merge branch 'tm-2815-do-you-recommend' into 'master' ([abb19b5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/abb19b57f6adb23383a55fdd6c172a811439cab7))
23
+ * Merge branch 'master' into tm-2815-do-you-recommend ([53360a3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/53360a312667eea07b7a91ebcf9b83da8ccf564c))
24
+
25
+ ## [7.1.59](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v7.1.58...v7.1.59) (2022-09-12)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * author cards ([5c50ffc](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5c50ffc41dd719220cd867c18fb67325e750b39b))
31
+ * newsletter form ([3133f28](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/3133f28e896303b71974ddfd282022544b718d56))
32
+ * update-core-version ([40fa9d5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/40fa9d5b399ff057eb3646fc0be0a04277059d8b))
33
+
34
+
35
+ * Merge branch 'core-version-update' into 'master' ([edca65f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/edca65ffacfb50474bc8b6cf27a7e013e31433de))
36
+ * Merge branch 'tm-3014-sign-up-form' into 'master' ([44aa2f7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/44aa2f7e7c56fcd50bff5d5ca1fa2f030b9d818e))
37
+
1
38
  ## [7.1.58](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v7.1.57...v7.1.58) (2022-09-08)
2
39
 
3
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "7.1.58",
3
+ "version": "7.1.60",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "gatsby": "^4.20.0",
27
- "gatsby-core-theme": "11.0.6",
27
+ "gatsby-core-theme": "11.0.8",
28
28
  "gatsby-plugin-sharp": "^4.10.2",
29
29
  "gatsby-plugin-sitemap": "^3.3.0",
30
30
  "gatsby-transformer-sharp": "^4.10.0",
@@ -16,7 +16,7 @@ import Author from '../../../../gatsby-core-theme/components/atoms/author';
16
16
  import BaseCard from '../base-card';
17
17
  import styles from './article-card.module.scss';
18
18
 
19
- const ArticleCard = ({ item, width, height, authorImage = true }) => {
19
+ const ArticleCard = ({ item, width, height, authorImage = false }) => {
20
20
  const { author, created_at, title, path, banner } = item;
21
21
  const pictureSource = {
22
22
  webp: '../../../../../../../images/default-article.webp',
@@ -0,0 +1,136 @@
1
+ .container {
2
+ margin: 0 auto;
3
+ max-width: var(--main-container-max);
4
+ }
5
+
6
+ .feedbackBox {
7
+ margin: 0px 2.4rem;
8
+ display: flex;
9
+ flex-direction: column;
10
+ justify-content: center;
11
+ padding: 3.2rem 2rem;
12
+ background-color: var(--background-feedback-color, #f1f2f9);
13
+ text-align: center;
14
+ > span {
15
+ padding-bottom: 4rem;
16
+ display: flex;
17
+ justify-content: center;
18
+ font-weight: 600;
19
+ font-size: 2.4rem;
20
+ line-height: 3.6rem;
21
+ color: var(--title-feedback-color, #1a1c1f);
22
+ }
23
+ .formBox {
24
+ display: flex;
25
+ justify-content: center;
26
+ .disabled{
27
+ background: #ddddddb4;
28
+ svg{
29
+ opacity: 0.4;
30
+ }
31
+ }
32
+
33
+ > span {
34
+ background: #ffffff;
35
+ border-radius: 100%;
36
+ text-align: center;
37
+ display: flex;
38
+ align-items: center;
39
+ min-width: 5.2rem;
40
+ height: 5.2rem;
41
+ border: 2px solid #E3E6EF;
42
+ cursor: pointer;
43
+ @include flex-direction(column);
44
+ @include flex-align(center, center);
45
+ @include min(tablet) {
46
+ min-width: 9.2rem;
47
+ height: 9.2rem;
48
+ }
49
+
50
+ &.like {
51
+ background: var(--like-backgorund-feedback, #5ce482);
52
+ color: var(--like-color,#ffffff);
53
+ }
54
+
55
+ &.dislike {
56
+ background: var(--dislike-backgorund-feedback, #ff6860);
57
+ color: var(--dislike-feedback ,#ffffff);
58
+ }
59
+
60
+ > svg {
61
+ width: 3.6rem;
62
+ height: 3.6rem;
63
+ }
64
+ }
65
+
66
+ > div {
67
+ display: flex;
68
+ flex-direction: column;
69
+ text-align: center;
70
+ padding: 0rem 2rem;
71
+
72
+ .number {
73
+ font-weight: 600;
74
+ font-size: 2.4rem;
75
+ line-height: 4.8rem;
76
+ color: var(--number-feedback-color,#323c46);
77
+ }
78
+ .text {
79
+ font-weight: 600;
80
+ font-size: 1.4rem;
81
+ line-height: 30px;
82
+ color: var(--text-feedback-color,#323c46);
83
+ }
84
+ @include min(tablet) {
85
+ padding: 0rem 3.8rem;
86
+ .number {
87
+ font-size: 3.2rem;
88
+ }
89
+ .text {
90
+ font-size: 1.8rem;
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ .details {
97
+ padding-top: 1.6rem;
98
+ text-align: center;
99
+ font-weight: 400;
100
+ font-size: 1.6rem;
101
+ line-height: 2.4rem;
102
+ color: var(--detailsText-feedback-color,#323c46);
103
+ }
104
+ .voted {
105
+ display: flex;
106
+ padding-top: 2rem;
107
+ flex-direction: column;
108
+ justify-content: center;
109
+ text-align: center;
110
+ > span {
111
+ font-weight: 600;
112
+ font-size: 18px;
113
+ line-height: 30px;
114
+ color:var(--thanksText-feedback-color,#1a1c1f);
115
+ }
116
+ .error{
117
+ color: var(--thanksText-feedback-color,red);
118
+ }
119
+ > p {
120
+ font-weight: 400;
121
+ font-size: 1.6rem;
122
+ line-height: 2.4rem;
123
+ color: var(--messageText-feedback-color,#323c46);
124
+ a{
125
+ margin-left: 0.4rem;
126
+ text-decoration: underline;
127
+ }
128
+ }
129
+ @include min(tablet){
130
+ padding-top: 4rem;
131
+ p{
132
+ font-size: 1.4rem;
133
+ }
134
+ }
135
+ }
136
+ }
@@ -0,0 +1,129 @@
1
+ import React, { useState, useContext } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { Link } from 'gatsby';
4
+ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
5
+ import { translate } from 'gatsby-core-theme/src/helpers/getters';
6
+ import { BiLike } from '@react-icons/all-files/bi/BiLike';
7
+ import { BiDislike } from '@react-icons/all-files/bi/BiDislike';
8
+
9
+ import styles from './feedback.module.scss';
10
+
11
+ const FeetBack = ({ pageId, casinoTitle, trueVotes, falseVotes, contactUs = '/contact-us' }) => {
12
+ const { translations } = useContext(Context) || {};
13
+ const [voted, setVote] = useState(null);
14
+ const [error, setError] = useState(null);
15
+ const [success, setSuccess] = useState(null);
16
+
17
+ async function addVote(feetBack) {
18
+ const votedUser = feetBack ? 1 : 0;
19
+ await fetch(`${process.env.GATSBY_API_URL}/sites/v0.1/page-votes`, {
20
+ method: 'POST',
21
+ headers: {
22
+ 'Content-Type': 'application/json',
23
+ },
24
+ body: JSON.stringify({
25
+ page_id: pageId,
26
+ vote: votedUser,
27
+ }),
28
+ })
29
+ .then((response) => response.json())
30
+ .then((data) => {
31
+ setVote(feetBack);
32
+ // eslint-disable-next-line no-unused-expressions
33
+ !data?.success ? setError(data.errors[0]) : setSuccess(true);
34
+ })
35
+ .catch((err) => {
36
+ console.log(err);
37
+ });
38
+ }
39
+
40
+ const vote = (feetBack) => {
41
+ addVote(feetBack);
42
+ };
43
+
44
+ return (
45
+ <div className={styles.container}>
46
+ <div className={styles.feedbackBox}>
47
+ <span>
48
+ {translate(
49
+ translations,
50
+ 'recomend_casino_title',
51
+ 'Would you recomend [casinoTitle] ?'
52
+ ).replace('[casinoTitle]', casinoTitle)}
53
+ </span>
54
+ <div className={styles.formBox}>
55
+ <span
56
+ onClick={voted === null ? () => vote(true) : null}
57
+ className={`${voted && styles.like} ${voted === false && styles.disabled}`}
58
+ aria-hidden="true"
59
+ >
60
+ <BiLike color="#323C46" />
61
+ </span>
62
+ <div>
63
+ <span className={styles.number}>{voted ? trueVotes + 1 : trueVotes} </span>
64
+
65
+ <span className={styles.text}>
66
+ {voted || voted === undefined || voted === null
67
+ ? translate(translations, 'recomend_casino', 'Recommendations')
68
+ : translate(translations, 'dont_recomend_casino', 'Don’t Recommend it')}
69
+ </span>
70
+ </div>
71
+ <span
72
+ onClick={voted === null ? () => vote(false) : null}
73
+ className={`${!voted && voted !== null && styles.dislike} ${voted && styles.disabled}`}
74
+ aria-hidden="true"
75
+ >
76
+ <BiDislike color="#323C46" />
77
+ </span>
78
+ </div>
79
+ {voted === null ? (
80
+ <div className={styles.details}>{`${trueVotes} ${translate(
81
+ translations,
82
+ 'of_feedback',
83
+ 'of'
84
+ )} ${trueVotes + falseVotes} ${translate(
85
+ translations,
86
+ 'user_recomend_feedback',
87
+ 'users recommend this casino'
88
+ )} `}</div>
89
+ ) : (
90
+ <div className={styles.voted}>
91
+ <span>{translate(translations, 'thanks_feedback', 'Thanks for your feedback!')}</span>
92
+ {error ? (
93
+ <p className={styles.error}>{translate(translations, 'error_info', error)}</p>
94
+ ) : (
95
+ <>
96
+ {success && (
97
+ <p>
98
+ {voted
99
+ ? translate(
100
+ translations,
101
+ 'positive_feedback',
102
+ 'What did you like about [casinoTitle]? Let us know, send us a message'
103
+ ).replace('[casinoTitle]', casinoTitle)
104
+ : translate(
105
+ translations,
106
+ 'negative_feedback',
107
+ 'Sorry about your experience at [casinoTitle]. What happened? send us a message'
108
+ ).replace('[casinoTitle]', casinoTitle)}
109
+ <Link to={contactUs}> {translate(translations, 'hereText', 'here')} </Link>.
110
+ </p>
111
+ )}
112
+ </>
113
+ )}
114
+ </div>
115
+ )}
116
+ </div>
117
+ </div>
118
+ );
119
+ };
120
+
121
+ FeetBack.propTypes = {
122
+ pageId: PropTypes.number,
123
+ casinoTitle: PropTypes.string,
124
+ trueVotes: PropTypes.number,
125
+ falseVotes: PropTypes.number,
126
+ contactUs: PropTypes.string,
127
+ };
128
+
129
+ export default FeetBack;
@@ -51,7 +51,7 @@ const Newsletter = ({ page, openBtnText = 'Unlock Bonuses', footer = false }) =>
51
51
  : styles.newsletter
52
52
  }
53
53
  >
54
- <Form redirectUrl={redirectUrl} ppcPage={ppcPage} />
54
+ <Form redirectUrl={redirectUrl} ppcPage={ppcPage} footer={footer} />
55
55
  {!footer ? (
56
56
  <MdClose className={styles.closeBtn} onClick={() => setToggleNewsletter(false)} />
57
57
  ) : null}
@@ -28,6 +28,9 @@ const Main = ({ section = {}, pageContext = {}, showNewsletter = true }) => {
28
28
  ? loadable(() => import(`gatsby-core-theme/src/components/atoms/not-found`))
29
29
  : null;
30
30
  const AuthorBox = page.author_id ? loadable(() => import(`~atoms/author-box`)) : null;
31
+ const Feedback =
32
+ page?.sections?.main?.feedbackCounter &&
33
+ loadable(() => import(`../../../../components/atoms/feedback`));
31
34
 
32
35
  return (
33
36
  <main className={styles.modulePage}>
@@ -41,6 +44,14 @@ const Main = ({ section = {}, pageContext = {}, showNewsletter = true }) => {
41
44
  {showNewsletter && <Newsletter page={page} />}
42
45
  {NewsletterSuccess && showNewsletter && <NewsletterSuccess />}
43
46
  {AuthorBox && <AuthorBox author={page.author} page={page} />}
47
+ {Feedback && (
48
+ <Feedback
49
+ trueVotes={page?.true_votes}
50
+ falseVotes={page?.false_votes}
51
+ pageId={page?.id}
52
+ casinoTitle={page?.title}
53
+ />
54
+ )}
44
55
  </main>
45
56
  );
46
57
  };
@@ -345,4 +345,4 @@
345
345
 
346
346
 
347
347
 
348
- window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/**/**/*.stories.js","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.js)$"},{"titlePrefix":"","directory":"./src","files":"**/**/**/**/*.stories.js","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.js)$"},{"titlePrefix":"","directory":"./src","files":"**/**/**/**/**/*.stories.js","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.js)$"}];</script><script src="runtime~main.eee2bd5c.iframe.bundle.js"></script><script src="252.a9c1a24e.iframe.bundle.js"></script><script src="main.bea31413.iframe.bundle.js"></script></body></html>
348
+ window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/**/**/*.stories.js","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.js)$"},{"titlePrefix":"","directory":"./src","files":"**/**/**/**/*.stories.js","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.js)$"},{"titlePrefix":"","directory":"./src","files":"**/**/**/**/**/*.stories.js","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.js)$"}];</script><script src="runtime~main.eee2bd5c.iframe.bundle.js"></script><script src="252.a9c1a24e.iframe.bundle.js"></script><script src="main.d8589f9c.iframe.bundle.js"></script></body></html>