gatsby-core-theme 44.5.0-poc.2 → 44.5.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/.ci.yml +2 -28
- package/CHANGELOG.md +233 -29
- package/gatsby-browser.js +48 -100
- package/gatsby-node.mjs +25 -21
- package/package.json +1 -1
- package/release.config.js +0 -5
- package/src/components/atoms/admin/button/index.js +1 -1
- package/src/components/atoms/author/index.js +6 -5
- package/src/components/atoms/collapse/collapse.test.js +113 -26
- package/src/components/atoms/collapse/index.js +23 -1
- package/src/components/atoms/comment-votes/comment-votes.module.scss +34 -0
- package/src/components/atoms/comment-votes/index.js +93 -0
- package/src/components/atoms/ratings/index.js +7 -0
- package/src/components/atoms/ratings/rating.test.js +1 -1
- package/src/components/molecules/comment/comment.module.scss +42 -74
- package/src/components/molecules/comment/index.js +108 -134
- package/src/components/molecules/header/variants/operator/template-one-two/index.js +4 -3
- package/src/components/molecules/header/variants/operator/template-one-two/template-one-two.stories.js +4 -3
- package/src/components/molecules/header/variants/operator/template-one-two/template-one-two.test.js +8 -8
- package/src/components/molecules/header/variants/slot/template-one/index.js +4 -3
- package/src/components/molecules/header/variants/slot/template-one/template-one.stories.js +4 -3
- package/src/components/molecules/leave-comment-form/index.js +25 -19
- package/src/components/molecules/spotlights_v2/icon/template-one/index.js +1 -1
- package/src/components/organisms/anchor/template-one/anchor.module.scss +19 -11
- package/src/components/organisms/archive/index.js +5 -2
- package/src/components/organisms/comments/comment-tree/comment-tree.module.scss +47 -0
- package/src/components/organisms/comments/comment-tree/index.js +8 -7
- package/src/components/organisms/comments/index.js +14 -26
- package/src/components/organisms/cookie-consent/index.js +48 -34
- package/src/components/organisms/form/fields/fields.module.scss +7 -4
- package/src/components/organisms/form/fields/index.js +101 -56
- package/src/components/organisms/form/form.module.scss +131 -39
- package/src/components/organisms/form/form.test.js +28 -33
- package/src/components/organisms/form/index.js +138 -78
- package/src/constants/forms.js +65 -14
- package/src/constants/ratings-constant.js +5 -0
- package/src/constants/schema.js +1 -0
- package/src/constants/settings.mjs +0 -1
- package/src/context/VotesProvider.js +49 -0
- package/src/helpers/replaceMedia.js +44 -1
- package/src/helpers/schema.js +32 -0
- package/src/helpers/tracker.mjs +2 -2
- package/src/resolver/index.mjs +8 -4
- package/src/resolver/modules.mjs +9 -6
- package/src/resolver/modules.test.js +1 -1
- package/src/resolver/redirect.mjs +23 -0
- package/src/resolver/redirect.test.js +65 -1
|
@@ -3,150 +3,124 @@
|
|
|
3
3
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
4
4
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
5
5
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
6
|
-
import React, {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
6
|
+
import React, { useState } from "react";
|
|
7
|
+
import PropTypes from "prop-types";
|
|
8
|
+
import LazyImage from "~hooks/lazy-image";
|
|
9
|
+
import LeaveCommentForm from "../leave-comment-form";
|
|
10
|
+
import useTranslate from "~hooks/useTranslate/useTranslate";
|
|
11
|
+
import CommentVotes from "../../atoms/comment-votes";
|
|
12
|
+
import { imagePrettyUrl } from "~helpers/getters";
|
|
13
|
+
import styles from "./comment.module.scss";
|
|
14
|
+
import VerifyIcon from "~images/icons/verify";
|
|
13
15
|
|
|
14
|
-
const Comment = ({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
showVotes = true
|
|
16
|
+
const Comment = ({
|
|
17
|
+
pageContext,
|
|
18
|
+
comment,
|
|
19
|
+
authors,
|
|
20
|
+
isReply,
|
|
21
|
+
showVotes = true,
|
|
21
22
|
}) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
const isAuthor = authors?.[comment?.author_id] || null;
|
|
24
|
+
const commentName = comment?.author_id
|
|
25
|
+
? authors?.[comment?.author_id]?.name
|
|
26
|
+
: comment.author_name;
|
|
27
|
+
const commentJobTitle = comment?.author_id
|
|
28
|
+
? authors?.[comment?.author_id]?.author_title
|
|
29
|
+
: undefined;
|
|
30
|
+
const image = comment?.author_id
|
|
31
|
+
? authors?.[comment?.author_id]?.image
|
|
32
|
+
: undefined;
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const handleVote = async (like = false, commentId) => {
|
|
38
|
-
const data = like
|
|
39
|
-
? {
|
|
40
|
-
"vote_up": "increase",
|
|
41
|
-
"commentID": commentId
|
|
42
|
-
}
|
|
43
|
-
: {
|
|
44
|
-
"vote_down": "increase",
|
|
45
|
-
"commentID": commentId
|
|
46
|
-
};
|
|
34
|
+
const date = new Date(comment.updated_at);
|
|
35
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
36
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
37
|
+
const year = date.getFullYear();
|
|
47
38
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Accept: "application/json",
|
|
52
|
-
},
|
|
53
|
-
};
|
|
39
|
+
const hours = String(date.getHours()).padStart(2, "0");
|
|
40
|
+
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
41
|
+
const commentDate = `${day}/${month}/${year} | ${hours}:${minutes}`;
|
|
54
42
|
|
|
55
|
-
|
|
56
|
-
.split('; ')
|
|
57
|
-
.find((row) => row.startsWith('comments='))
|
|
58
|
-
?.split('=')[1] || '';
|
|
43
|
+
const [reply, setReply] = useState(false);
|
|
59
44
|
|
|
60
|
-
|
|
45
|
+
|
|
61
46
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
</>
|
|
121
|
-
)}
|
|
122
|
-
{!isReply && (
|
|
123
|
-
<button aria-label='Reply Button' onClick={() => setReply(!reply)} type='button' className={styles.replyButton}>
|
|
124
|
-
{reply ? useTranslate('cancel_reply_button', 'Cancel Reply') : useTranslate('reply_button', 'Reply')}
|
|
125
|
-
</button>
|
|
126
|
-
)}
|
|
127
|
-
</div>
|
|
128
|
-
{reply && <LeaveCommentForm page={pageContext.page} isReply parentCommentID={comment.comment_id} />}
|
|
129
|
-
</div>
|
|
47
|
+
return (
|
|
48
|
+
<div
|
|
49
|
+
className={`${styles.commentContainer} ${isReply ? styles.isReply : ""}`}
|
|
50
|
+
>
|
|
51
|
+
{isAuthor && (
|
|
52
|
+
<div className={styles.replyIndicator}>
|
|
53
|
+
<span>
|
|
54
|
+
{useTranslate("reply_from_the_author", "Reply from the Author:")}
|
|
55
|
+
</span>
|
|
56
|
+
</div>
|
|
57
|
+
)}
|
|
58
|
+
<div className={styles.commentTopArea}>
|
|
59
|
+
<LazyImage
|
|
60
|
+
src={image ? imagePrettyUrl(image, 50, 50) : "/images/anon-user.svg"}
|
|
61
|
+
alt={`${commentName || "Anonymous User"} user image`}
|
|
62
|
+
/>
|
|
63
|
+
<span className={styles.commentName}>
|
|
64
|
+
{commentName || "Anonymous User"}
|
|
65
|
+
{isAuthor && (
|
|
66
|
+
<VerifyIcon />
|
|
67
|
+
)}
|
|
68
|
+
</span>
|
|
69
|
+
{commentJobTitle && (
|
|
70
|
+
<span className={styles.commentJobTitle}>{commentJobTitle}</span>
|
|
71
|
+
)}
|
|
72
|
+
<span className={styles.commentDate}>{commentDate}</span>
|
|
73
|
+
</div>
|
|
74
|
+
<div
|
|
75
|
+
className={`${styles.commentContent} ${
|
|
76
|
+
isReply ? styles.isReplyThread : ""
|
|
77
|
+
}`}
|
|
78
|
+
>
|
|
79
|
+
<p>{comment.comment}</p>
|
|
80
|
+
</div>
|
|
81
|
+
<div className={styles.commentActions}>
|
|
82
|
+
{showVotes && <CommentVotes comment={comment} />}
|
|
83
|
+
{!isReply && (
|
|
84
|
+
<button
|
|
85
|
+
aria-label="Reply Button"
|
|
86
|
+
onClick={() => setReply(!reply)}
|
|
87
|
+
type="button"
|
|
88
|
+
className={styles.replyButton}
|
|
89
|
+
>
|
|
90
|
+
{reply
|
|
91
|
+
? useTranslate("cancel_reply_button", "Cancel Reply")
|
|
92
|
+
: useTranslate("reply_button", "Reply")}
|
|
93
|
+
</button>
|
|
94
|
+
)}
|
|
95
|
+
</div>
|
|
96
|
+
{reply && (
|
|
97
|
+
<LeaveCommentForm
|
|
98
|
+
page={pageContext.page}
|
|
99
|
+
isReply
|
|
100
|
+
parentCommentID={comment.comment_id}
|
|
101
|
+
/>
|
|
102
|
+
)}
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
130
105
|
};
|
|
131
106
|
|
|
132
107
|
Comment.propTypes = {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
showVotes: PropTypes.bool
|
|
108
|
+
pageContext: PropTypes.shape({
|
|
109
|
+
page: PropTypes.shape({}),
|
|
110
|
+
}),
|
|
111
|
+
comment: PropTypes.shape({
|
|
112
|
+
comment_id: PropTypes.number,
|
|
113
|
+
author_id: PropTypes.number,
|
|
114
|
+
author_name: PropTypes.string,
|
|
115
|
+
email: PropTypes.string,
|
|
116
|
+
comment: PropTypes.string,
|
|
117
|
+
updated_at: PropTypes.string,
|
|
118
|
+
votes_up: PropTypes.number,
|
|
119
|
+
votes_down: PropTypes.number,
|
|
120
|
+
}),
|
|
121
|
+
authors: PropTypes.shape({}),
|
|
122
|
+
isReply: PropTypes.bool,
|
|
123
|
+
showVotes: PropTypes.bool,
|
|
150
124
|
};
|
|
151
125
|
|
|
152
126
|
export default Comment;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { lazy, Suspense } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
4
4
|
import { FaStar } from '@react-icons/all-files/fa/FaStar';
|
|
@@ -7,7 +7,6 @@ import { getAltText } from '~helpers/image';
|
|
|
7
7
|
import LazyImage from '~hooks/lazy-image';
|
|
8
8
|
import StarRating from '~molecules/star-rating/one-star';
|
|
9
9
|
import useTranslate from '~hooks/useTranslate/useTranslate';
|
|
10
|
-
import Verify from '~images/icons/verify';
|
|
11
10
|
import Rating from '~atoms/ratings';
|
|
12
11
|
import OperatorBanner from '~atoms/header-operator-bannner';
|
|
13
12
|
import VariableComponent from '../variables';
|
|
@@ -16,6 +15,8 @@ import { TrackingKeys } from '~constants/tracking-api'
|
|
|
16
15
|
import PrettyLink from '~atoms/pretty-link';
|
|
17
16
|
import Ribbons from '~atoms/ribbons';
|
|
18
17
|
|
|
18
|
+
const VerifyIcon = lazy(() => import('~images/icons/verify'));
|
|
19
|
+
|
|
19
20
|
const TemplateOneTwo = ({
|
|
20
21
|
relation,
|
|
21
22
|
type,
|
|
@@ -70,7 +71,7 @@ const TemplateOneTwo = ({
|
|
|
70
71
|
>
|
|
71
72
|
<div className={styles.name}>
|
|
72
73
|
<h1>{name}</h1>
|
|
73
|
-
{icon || <
|
|
74
|
+
{icon || <Suspense fallback={null}><VerifyIcon /></Suspense>}
|
|
74
75
|
</div>
|
|
75
76
|
{ribbon && <Ribbons customStyle={template === 'template_two' ? styles.templateTwoRibbon : ''} item={[relation.ribbons[0]]} /> }
|
|
76
77
|
{!['coming_soon', 'inactive'].includes(relation?.status) ? (
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { lazy } from "react";
|
|
2
2
|
import TemplateOne from ".";
|
|
3
3
|
import getOperatorData from "../../../../../../../tests/factories/relations/operator.factory";
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
const VerifyIcon = lazy(() => import('~images/icons/verify'));
|
|
5
6
|
|
|
6
7
|
const pageOperatorData = getOperatorData();
|
|
7
8
|
|
|
@@ -45,7 +46,7 @@ export default {
|
|
|
45
46
|
},
|
|
46
47
|
icon: {
|
|
47
48
|
name: "Icon",
|
|
48
|
-
defaultValue: <
|
|
49
|
+
defaultValue: <VerifyIcon />,
|
|
49
50
|
},
|
|
50
51
|
},
|
|
51
52
|
};
|
package/src/components/molecules/header/variants/operator/template-one-two/template-one-two.test.js
CHANGED
|
@@ -10,26 +10,26 @@ describe('Operator template one two component', () => {
|
|
|
10
10
|
|
|
11
11
|
test('Template One Status Active', () => {
|
|
12
12
|
const { container, getByText } = render(<TemplateOneTwo {...data} type="operator" />);
|
|
13
|
-
expect(getByText('Ice Casino')).
|
|
13
|
+
expect(getByText('Ice Casino')).toBeInTheDocument();
|
|
14
14
|
expect(container.querySelectorAll('h1')).toHaveLength(1);
|
|
15
15
|
expect(container.querySelectorAll('a')).toHaveLength(3);
|
|
16
|
-
expect(getByText('100% Bonus')).
|
|
17
|
-
expect(getByText('+ Big Promotions')).
|
|
16
|
+
expect(getByText('100% Bonus')).toBeInTheDocument();
|
|
17
|
+
expect(getByText('+ Big Promotions')).toBeInTheDocument();
|
|
18
18
|
expect(container.querySelectorAll('ul')).toHaveLength(1);
|
|
19
|
-
expect(container.querySelectorAll('li')).toHaveLength(
|
|
19
|
+
expect(container.querySelectorAll('li')).toHaveLength(7);
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
test('Template Two Status Active', () => {
|
|
23
23
|
const { container, getByText } = render(
|
|
24
24
|
<TemplateOneTwo {...data} template="template_two" type="operator" />
|
|
25
25
|
);
|
|
26
|
-
expect(getByText('Ice Casino')).
|
|
26
|
+
expect(getByText('Ice Casino')).toBeInTheDocument();
|
|
27
27
|
expect(container.querySelectorAll('h1')).toHaveLength(1);
|
|
28
28
|
expect(container.querySelectorAll('a')).toHaveLength(3);
|
|
29
|
-
expect(getByText('100% Bonus')).
|
|
30
|
-
expect(getByText('+ Big Promotions')).
|
|
29
|
+
expect(getByText('100% Bonus')).toBeInTheDocument();
|
|
30
|
+
expect(getByText('+ Big Promotions')).toBeInTheDocument();
|
|
31
31
|
expect(container.querySelectorAll('ul')).toHaveLength(1);
|
|
32
|
-
expect(container.querySelectorAll('li')).toHaveLength(
|
|
32
|
+
expect(container.querySelectorAll('li')).toHaveLength(7);
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
35
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { lazy, Suspense } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
4
|
import { FaStar } from '@react-icons/all-files/fa/FaStar';
|
|
@@ -6,14 +6,15 @@ import { imagePrettyUrl } from '~helpers/getters';
|
|
|
6
6
|
import OperatorBanner from '~atoms/header-operator-bannner';
|
|
7
7
|
import Rating from '~atoms/ratings';
|
|
8
8
|
import { getAltText } from '~helpers/image';
|
|
9
|
-
import Verify from '~images/icons/verify';
|
|
10
9
|
import { TrackingKeys } from '~constants/tracking-api'
|
|
11
10
|
import styles from './slot.module.scss';
|
|
12
11
|
|
|
12
|
+
const VerifyIcon = lazy(() => import('~images/icons/verify'));
|
|
13
|
+
|
|
13
14
|
export default function SlotHeader({
|
|
14
15
|
page,
|
|
15
16
|
moduleName = TrackingKeys?.HEADERSLOTS,
|
|
16
|
-
image = <
|
|
17
|
+
image = <Suspense fallback={null}><VerifyIcon /></Suspense>,
|
|
17
18
|
showExtraRatings = false,
|
|
18
19
|
width = 170,
|
|
19
20
|
height = 170,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* eslint-disable react/destructuring-assignment */
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { lazy } from 'react';
|
|
3
3
|
import TemplateOne from '.';
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
const VerifyIcon = lazy(() => import('~images/icons/verify'));
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
title: 'Theme/Layout/Header/Games/Template One',
|
|
@@ -67,6 +68,6 @@ Default.args = {
|
|
|
67
68
|
},
|
|
68
69
|
},
|
|
69
70
|
},
|
|
70
|
-
image: <
|
|
71
|
+
image: <VerifyIcon />,
|
|
71
72
|
headerBonus: true,
|
|
72
73
|
};
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
3
3
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import axios from "axios";
|
|
6
5
|
import Form from "gatsby-core-theme/src/components/organisms/form";
|
|
7
6
|
import PropTypes from 'prop-types';
|
|
8
7
|
import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
|
|
@@ -19,13 +18,14 @@ const LeaveCommentForm = ({
|
|
|
19
18
|
failMessage = 'Comment Not Added',
|
|
20
19
|
validationMessage = 'Fill all required fields',
|
|
21
20
|
buttonIcon = <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />,
|
|
21
|
+
titleTag = 'h2',
|
|
22
22
|
}) => {
|
|
23
23
|
const activeMarket = page?.market;
|
|
24
|
+
const isDev = process.env.NODE_ENV === 'development';
|
|
24
25
|
|
|
25
26
|
const customSubmit = (form, resetForm) => {
|
|
26
27
|
const formData = new FormData(form);
|
|
27
|
-
const data = Object.fromEntries(formData.entries());
|
|
28
|
-
|
|
28
|
+
const data = Object.fromEntries(formData.entries());
|
|
29
29
|
const cleanedData = isReply
|
|
30
30
|
? Object.entries(data).reduce((acc, [key, value]) => {
|
|
31
31
|
if (key.startsWith('post_anonymously_')) acc.post_anonymously = value;
|
|
@@ -34,8 +34,10 @@ const LeaveCommentForm = ({
|
|
|
34
34
|
return acc;
|
|
35
35
|
}, {})
|
|
36
36
|
: data;
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
if((cleanedData?.["g-recaptcha-response"] === '' || !cleanedData?.tnc) && !isDev) return;
|
|
40
|
+
|
|
39
41
|
if(parentCommentID) cleanedData.parent_id = parentCommentID;
|
|
40
42
|
|
|
41
43
|
cleanedData.reference_id = page?.id;
|
|
@@ -50,22 +52,24 @@ const LeaveCommentForm = ({
|
|
|
50
52
|
delete cleanedData?.post_anonymously;
|
|
51
53
|
delete cleanedData?.tnc;
|
|
52
54
|
|
|
53
|
-
const headers = {
|
|
54
|
-
headers: {
|
|
55
|
-
"Content-Type": "application/json",
|
|
56
|
-
Accept: "application/json",
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
55
|
return new Promise((resolve, reject) => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
56
|
+
fetch(`${process.env.GATSBY_API_COMMENT_URL}/api/post-comment`, {
|
|
57
|
+
method: 'POST',
|
|
58
|
+
headers: {
|
|
59
|
+
'Content-Type': 'application/json',
|
|
60
|
+
},
|
|
61
|
+
body: JSON.stringify(cleanedData),
|
|
62
|
+
})
|
|
63
|
+
.then(async (response) => {
|
|
64
|
+
if (response.ok) {
|
|
65
|
+
resetForm();
|
|
66
|
+
resolve(response);
|
|
67
|
+
} else {
|
|
68
|
+
const errorData = await response.json().catch(() => ({}));
|
|
69
|
+
reject(errorData?.errors?.join() || response.statusText);
|
|
70
|
+
}
|
|
67
71
|
})
|
|
68
|
-
.catch((error) => reject(error
|
|
72
|
+
.catch((error) => reject(error.message));
|
|
69
73
|
});
|
|
70
74
|
};
|
|
71
75
|
|
|
@@ -82,6 +86,7 @@ const LeaveCommentForm = ({
|
|
|
82
86
|
validationMessage={validationMessage}
|
|
83
87
|
path={page?.path}
|
|
84
88
|
buttonIcon={buttonIcon}
|
|
89
|
+
titleType={titleTag}
|
|
85
90
|
customClass='commentForm'
|
|
86
91
|
/>
|
|
87
92
|
};
|
|
@@ -101,6 +106,7 @@ LeaveCommentForm.propTypes = {
|
|
|
101
106
|
showButtonIcon: PropTypes.bool,
|
|
102
107
|
showLabels: PropTypes.bool,
|
|
103
108
|
buttonIcon: PropTypes.element,
|
|
109
|
+
titleTag: PropTypes.string,
|
|
104
110
|
};
|
|
105
111
|
|
|
106
112
|
export default LeaveCommentForm;
|
|
@@ -18,7 +18,7 @@ export default function TemplateOne({ module, width = 106, height = 106, loading
|
|
|
18
18
|
height={height}
|
|
19
19
|
width={width}
|
|
20
20
|
src={imagePrettyUrl(res?.icon, width, height)}
|
|
21
|
-
alt={getAltText(res?.image_object || res?.icon_object, res?.label)}
|
|
21
|
+
alt={getAltText(res?.image_object || res?.icon_object, res?.label || res.link_text)}
|
|
22
22
|
loading={loadingImg}
|
|
23
23
|
/>
|
|
24
24
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@keyframes
|
|
1
|
+
@keyframes fade-in {
|
|
2
2
|
0% {
|
|
3
3
|
opacity: 0;
|
|
4
4
|
}
|
|
@@ -24,16 +24,17 @@
|
|
|
24
24
|
|
|
25
25
|
.defaultConatiner {
|
|
26
26
|
position: relative;
|
|
27
|
+
|
|
27
28
|
@include flex-direction(row);
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
.anchor {
|
|
31
32
|
max-width: var(--main-container-max);
|
|
33
|
+
|
|
32
34
|
@include flex-direction(row);
|
|
33
35
|
|
|
34
36
|
&::-webkit-scrollbar {
|
|
35
37
|
height: 0.4rem;
|
|
36
|
-
// display: none;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
&::-webkit-scrollbar-track {
|
|
@@ -49,23 +50,26 @@
|
|
|
49
50
|
|
|
50
51
|
.stickyContainer {
|
|
51
52
|
position: fixed;
|
|
52
|
-
z-index:
|
|
53
|
-
animation:
|
|
53
|
+
z-index: 2;
|
|
54
|
+
animation: fade-in 1s forwards;
|
|
54
55
|
width: 100%;
|
|
55
|
-
background-color:
|
|
56
|
-
box-shadow:
|
|
56
|
+
background-color: #fff;
|
|
57
|
+
box-shadow: 0 8px 12px 0;
|
|
57
58
|
left: 0;
|
|
58
59
|
right: 0;
|
|
59
60
|
top: var(--nav-height);
|
|
61
|
+
|
|
60
62
|
@include flex-direction(row);
|
|
61
63
|
@include flex-align(center, center);
|
|
64
|
+
|
|
62
65
|
padding-bottom: 0.5rem;
|
|
63
|
-
.anchor{
|
|
64
66
|
|
|
67
|
+
.anchor{
|
|
65
68
|
&::-webkit-scrollbar {
|
|
66
69
|
display: none;
|
|
67
70
|
}
|
|
68
71
|
}
|
|
72
|
+
|
|
69
73
|
&.usingExclOperator {
|
|
70
74
|
top: calc(var(--nav-height) + var(--exc-operator-height));
|
|
71
75
|
}
|
|
@@ -84,6 +88,7 @@
|
|
|
84
88
|
line-height: 27px;
|
|
85
89
|
|
|
86
90
|
@include flex-align(center, center);
|
|
91
|
+
|
|
87
92
|
margin-right: 1.6rem;
|
|
88
93
|
margin-bottom: 0.5rem;
|
|
89
94
|
margin-top: 0.5rem;
|
|
@@ -95,7 +100,7 @@
|
|
|
95
100
|
@include min(laptop) {
|
|
96
101
|
&:hover {
|
|
97
102
|
background-color: #272735;
|
|
98
|
-
color: #
|
|
103
|
+
color: #fff;
|
|
99
104
|
}
|
|
100
105
|
}
|
|
101
106
|
}
|
|
@@ -119,11 +124,14 @@
|
|
|
119
124
|
.buttLeft,
|
|
120
125
|
.buttRight {
|
|
121
126
|
@include flex-align(center, center);
|
|
122
|
-
|
|
127
|
+
|
|
128
|
+
background-color: var(--body-background-color, #fff);
|
|
129
|
+
|
|
123
130
|
@include flex-align(center, center);
|
|
131
|
+
|
|
124
132
|
display: none;
|
|
125
133
|
z-index: 1;
|
|
126
|
-
padding:
|
|
134
|
+
padding: 0 1rem;
|
|
127
135
|
|
|
128
136
|
@include custom-min(960) {
|
|
129
137
|
display: flex;
|
|
@@ -133,7 +141,7 @@
|
|
|
133
141
|
width: 3.2rem;
|
|
134
142
|
height: 3.2rem;
|
|
135
143
|
padding: 0.8rem;
|
|
136
|
-
color: #
|
|
144
|
+
color: #fff;
|
|
137
145
|
background-color: #262629;
|
|
138
146
|
border-radius: 10rem;
|
|
139
147
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
1
2
|
/* eslint-disable no-nested-ternary */
|
|
2
3
|
import React, { useState, useEffect } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
@@ -32,8 +33,9 @@ const Archive = ({ module, page, loadMore, gtmClass = '', anchorLabel, modulePos
|
|
|
32
33
|
setModuleItems(items);
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
|
-
|
|
36
|
-
const loadMoreText = useTranslate('load_more', 'Load More');
|
|
36
|
+
|
|
37
|
+
const loadMoreText = useTranslate(`load_more_${module?.model_type}`) || useTranslate('load_more', 'Load More');
|
|
38
|
+
|
|
37
39
|
updatedModule.items = moduleItems;
|
|
38
40
|
return (
|
|
39
41
|
<>
|
|
@@ -73,6 +75,7 @@ Archive.propTypes = {
|
|
|
73
75
|
items: PropTypes.arrayOf(PropTypes.object),
|
|
74
76
|
pagination_type: PropTypes.string,
|
|
75
77
|
num_of_items: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
78
|
+
model_type: PropTypes.string,
|
|
76
79
|
}).isRequired,
|
|
77
80
|
loadMore: PropTypes.shape({
|
|
78
81
|
label: PropTypes.string,
|