gatsby-core-theme 30.0.82 → 30.0.83

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/package.json +1 -1
  3. package/src/components/atoms/author-box/description/author-description.module.scss +51 -0
  4. package/src/components/atoms/author-box/description/index.js +49 -0
  5. package/src/components/atoms/author-box/details/author-details.module.scss +210 -0
  6. package/src/components/atoms/author-box/details/index.js +97 -0
  7. package/src/components/atoms/author-box/icons/socialIcons.js +36 -0
  8. package/src/components/atoms/author-box/index.js +17 -283
  9. package/src/components/atoms/author-box/template-one/author-box.module.scss +46 -0
  10. package/src/components/atoms/author-box/{author-box.stories.js → template-one/author-box.stories.js} +9 -31
  11. package/src/components/atoms/author-box/{author-box.test.js → template-one/author-box.test.js} +3 -23
  12. package/src/components/atoms/author-box/template-one/fact-check/fact-check.module.scss +91 -0
  13. package/src/components/atoms/author-box/template-one/fact-check/index.js +76 -0
  14. package/src/components/atoms/author-box/template-one/index.js +26 -0
  15. package/src/components/atoms/author-box/template-three/author-box.module.scss +40 -0
  16. package/src/components/atoms/author-box/template-three/author-box.stories.js +125 -0
  17. package/src/components/atoms/author-box/template-three/author-box.test.js +34 -0
  18. package/src/components/atoms/author-box/template-three/expertion/expertion.module.scss +27 -0
  19. package/src/components/atoms/author-box/template-three/expertion/index.js +22 -0
  20. package/src/components/atoms/author-box/template-three/fact-check/fact-check.module.scss +81 -0
  21. package/src/components/atoms/author-box/template-three/fact-check/index.js +76 -0
  22. package/src/components/atoms/author-box/template-three/index.js +29 -0
  23. package/src/components/atoms/author-box/template-two/author-box.module.scss +19 -0
  24. package/src/components/atoms/author-box/template-two/author-box.stories.js +123 -0
  25. package/src/components/atoms/author-box/template-two/author-box.test.js +34 -0
  26. package/src/components/atoms/author-box/template-two/fact-check/fact-check.module.scss +74 -0
  27. package/src/components/atoms/author-box/template-two/fact-check/index.js +76 -0
  28. package/src/components/atoms/author-box/template-two/index.js +23 -0
  29. package/src/components/molecules/footer/index.js +2 -2
  30. package/src/images/icons/fact-check.js +19 -0
  31. package/tests/factories/authors/author.factory.js +1 -0
  32. package/src/components/atoms/author-box/author-box.module.scss +0 -311
package/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## [30.0.83](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.82...v30.0.83) (2024-02-20)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add template two and three ([46b4da8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/46b4da87222f44839f9ccdc895ae87c2b21a1598))
7
+ * align template two ([e275e44](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e275e44f98196f29e7aeb3e2dab05a06cbda1dc8))
8
+ * author box structure ([4c01e58](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4c01e58f3de59ece3fff4735ddc25c2429aebcf6))
9
+ * clean up and add storybook ([18dc6e3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/18dc6e3961d7f29bdf6a04e2bcf70ccd6e1b48a4))
10
+ * fixed props ([17e5774](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/17e57748e1c853ec5c8a2941760ad9c62c2be39c))
11
+ * make style ([c3ee782](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c3ee782e1d15b3a0fe3762c1588da1ffbaccfcd4))
12
+ * make style ([7681944](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7681944fd4d74cccba968697f27b011e43bc80d1))
13
+ * make style ([be17043](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/be17043532382b48c2c2c046a07faa32d9f4debd))
14
+ * make style ([05a40af](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/05a40afbb9637bf84497b64ffdb5cc3e3da8573f))
15
+ * make style ([50d5902](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/50d5902d0e05e7ab8a130fdd0dcb6ca4032e98cc))
16
+ * make style ([f669d92](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/f669d9205efa71258415d3f769f9a6841b2ec34f))
17
+ * make style for template three+ ([0736e82](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0736e829c35cfdc6b2b701ad9aeff2d3deecd057))
18
+ * refactor code ([7d68a6d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7d68a6df291647cddf2ee70705f8a89f18c74e74))
19
+ * remove fact check ([e5c945f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e5c945fa0f6838161ce21deb2dd1ee5717873be7))
20
+ * storybbok ([4a35785](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4a35785617f50f6b144b949fc395447456a4a43e))
21
+
22
+
23
+ * Merge branch 'tm-4047-market-helpline' into 'master' ([c467469](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c4674691404385059ec9605fda6011716dc3ad6e))
24
+ * Merge branch 'tm-3980-author-box' into 'master' ([7c21f5c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7c21f5cc42a87797a27033b25076db64e61a4190))
25
+ * Merge branch 'master' into tm-3980-author-box ([225b338](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/225b338ac49a17a16b15123e2851d075d85be732))
26
+ * Merge branch 'master' into tm-3980-author-box ([2fb1dcb](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2fb1dcb1aae1860cdebde701c895793df57098c5))
27
+
1
28
  ## [30.0.82](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.81...v30.0.82) (2024-02-20)
2
29
 
3
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "30.0.82",
3
+ "version": "30.0.83",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -0,0 +1,51 @@
1
+ .description {
2
+ @include flex-direction(column);
3
+ flex: 3;
4
+ align-self: stretch;
5
+ position: relative;
6
+ margin-bottom: 1rem;
7
+ @include min(laptop){
8
+ grid-column: 2/3;
9
+ grid-row: 1/2;
10
+ }
11
+ }
12
+ .continueRead {
13
+ position: absolute;
14
+ right: 0;
15
+ bottom: 0;
16
+ }
17
+
18
+ .biography {
19
+ font-size: 1.4rem;
20
+ line-height: 2.2rem;
21
+ color: #515156;
22
+ margin-bottom: 1.6rem;
23
+ @include min(laptop){
24
+ margin-bottom: .8rem;
25
+ }
26
+
27
+ p {
28
+ display: inline-block;
29
+ }
30
+
31
+ a {
32
+ display: initial;
33
+ }
34
+ }
35
+
36
+ .readMore {
37
+ @include flex-align(center, flex-start);
38
+ color: #2563eb;
39
+ font-size: 1.4rem;
40
+ font-style: normal;
41
+ font-weight: 700;
42
+ line-height: 2.1rem;
43
+ gap: 0.8rem;
44
+ text-transform: capitalize;
45
+ }
46
+
47
+ .templateTwo{
48
+ @include min(tablet){
49
+ padding-left:13rem;
50
+ }
51
+ }
@@ -0,0 +1,49 @@
1
+ import React, { useContext, useRef } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
4
+ import { translate } from '~helpers/getters';
5
+ import styles from './author-description.module.scss';
6
+ import Link from '~hooks/link';
7
+ import { Context } from '~context/MainProvider';
8
+
9
+ export default function AuthorDescription({
10
+ author,
11
+ contReadIcon = <FaArrowRight title="Right-pointing Arrow Icon" />,
12
+ template = '',
13
+ }) {
14
+ const { translations } = useContext(Context) || {};
15
+ const biographyRef = useRef(null);
16
+
17
+ return (
18
+ <div className={`${styles.description || ''} ${styles[template]}`}>
19
+ <div
20
+ ref={biographyRef}
21
+ className={`${styles.biography}`}
22
+ dangerouslySetInnerHTML={{
23
+ __html: author?.biography,
24
+ }}
25
+ />
26
+ {author?.profile_page_path && (
27
+ <Link
28
+ to={author?.profile_page_path}
29
+ title={author?.name}
30
+ className={`${styles.readMore || ''} author-gtm`}
31
+ >
32
+ {translate(translations, 'cont_read', 'continue reading')}
33
+ {contReadIcon}
34
+ </Link>
35
+ )}
36
+ </div>
37
+ );
38
+ }
39
+
40
+ AuthorDescription.propTypes = {
41
+ author: PropTypes.shape({
42
+ name: PropTypes.string,
43
+ biography: PropTypes.string,
44
+ expertise: PropTypes.arrayOf(PropTypes.string),
45
+ profile_page_path: PropTypes.string,
46
+ }).isRequired,
47
+ contReadIcon: PropTypes.node,
48
+ template: PropTypes.string,
49
+ };
@@ -0,0 +1,210 @@
1
+ .details {
2
+ display: flex;
3
+ gap: 1.6rem;
4
+ font-size: 1.4rem;
5
+ line-height: 2.2rem;
6
+ color: #6e7074;
7
+ gap: 1.6rem;
8
+ @include flex-direction(row);
9
+ @include min(laptop) {
10
+ grid-column: 1/2;
11
+ grid-row: 1/3;
12
+ }
13
+
14
+ > img {
15
+ border-radius: 1.2rem;
16
+ border: 1.5px solid #ececec;
17
+ background: lightgray 50% / cover no-repeat;
18
+ height: 9.65rem;
19
+ width: 9.65rem;
20
+ object-fit: contain;
21
+ @include min(laptop) {
22
+ width: 15.6rem;
23
+ height: 15.6rem;
24
+ }
25
+ }
26
+ }
27
+
28
+ .information {
29
+ @include flex-direction(column);
30
+ padding: 0 12px 0 0;
31
+ flex: 1;
32
+ padding: 0;
33
+ justify-content: space-around;
34
+ @include min(tablet) {
35
+ min-width: 16rem;
36
+ max-height: 10rem;
37
+ }
38
+ }
39
+
40
+ .name {
41
+ color: #1b1b1c;
42
+ font-size: 1.6rem;
43
+ font-style: normal;
44
+ font-weight: 700;
45
+ line-height: 2.7rem;
46
+
47
+ > svg {
48
+ margin-left: 0.4rem;
49
+ width: 1.5rem;
50
+ height: 1.5rem;
51
+ }
52
+ }
53
+
54
+ .title {
55
+ color: #64646d;
56
+ font-size: 1.4rem;
57
+ font-style: normal;
58
+ font-weight: 700;
59
+ line-height: 2.2rem;
60
+ }
61
+
62
+ .socialIcons {
63
+ display: flex;
64
+ margin-bottom: 1rem;
65
+ margin: 0 0 0;
66
+
67
+ a {
68
+ @include flex-align(center, center);
69
+ width: 24px;
70
+ height: 24px;
71
+ background: #262629;
72
+ margin-right: 0.8rem;
73
+ border-radius: 100%;
74
+
75
+ &:last-of-type {
76
+ margin: 0;
77
+ }
78
+
79
+ img,
80
+ svg {
81
+ fill: #fff;
82
+ width: 1.2rem;
83
+ }
84
+ }
85
+ }
86
+
87
+ .ribbon {
88
+ border-radius: 10rem;
89
+ padding: 0.4rem 0.8rem;
90
+ background: #165af8;
91
+ color: #fff;
92
+ text-align: center;
93
+ font-size: 0.9rem;
94
+ font-style: normal;
95
+ font-weight: 700;
96
+ line-height: normal;
97
+ letter-spacing: 0.5px;
98
+ text-transform: uppercase;
99
+ max-height: 1.9rem;
100
+ }
101
+
102
+ .ribbonAndExpert {
103
+ @include flex-direction(row);
104
+ @include flex-align(center, start);
105
+ margin-top: 0.8rem;
106
+ margin-bottom: 1.6rem;
107
+ gap: 1.6rem;
108
+ @include min(tablet){
109
+ grid-column: 1/3;
110
+ grid-row: 2/3;
111
+ }
112
+ }
113
+
114
+ .authorStats {
115
+ padding-top: 2.4rem;
116
+ @include min(tablet){
117
+ grid-column: 1/3;
118
+ grid-row: 3/4;
119
+ padding-top: 1rem;
120
+ }
121
+ p {
122
+ display: inline-block;
123
+ margin-right: 1.6rem;
124
+ span {
125
+ color: #1b1b1c;
126
+ font-size: 1.4rem;
127
+ font-weight: 700;
128
+ line-height: 2.2rem;
129
+ margin-right: .4rem;
130
+ }
131
+ &:nth-child(2){
132
+ &::first-letter{
133
+ color: #1b1b1c;
134
+ font-size: 1.4rem;
135
+ font-style: normal;
136
+ font-weight: 700;
137
+ line-height: 2.2rem;
138
+ }
139
+ }
140
+ }
141
+ }
142
+
143
+ .templateTwo {
144
+ @include flex-direction(column);
145
+ @include min(tablet){
146
+ @include flex-direction(row);
147
+ @include flex-align(center, start);
148
+ }
149
+ > img {
150
+ width: 8rem;
151
+ height: 8rem;
152
+ border-radius: 50%;
153
+ @include min(tablet){
154
+ width: 11.2rem;
155
+ height: 11.2rem;
156
+ }
157
+ @include min(tablet){
158
+ width: 12.8rem;
159
+ height: 12.8rem;
160
+ }
161
+ }
162
+ .socialIcons{
163
+ @include min(tablet){
164
+ position: absolute;
165
+ right: 2.4rem;
166
+ top: 2.4rem;
167
+ }
168
+ }
169
+ > div {
170
+ > p {
171
+ > span {
172
+ font-size: 2rem;
173
+ }
174
+ }
175
+ }
176
+ }
177
+
178
+ .templateThree{
179
+ display: flex;
180
+ font-size: 1.4rem;
181
+ line-height: 2.2rem;
182
+ color: #6e7074;
183
+ gap: 1.6rem;
184
+ @include flex-direction(row);
185
+ @include min(tablet) {
186
+ @include flex-direction(row);
187
+ }
188
+
189
+ @include min(laptop){
190
+ grid-column: 1/2;
191
+ grid-row: 1/4;
192
+ @include flex-direction(column);
193
+ }
194
+
195
+ > img {
196
+ border-radius: 100%;
197
+ border: 1.5px solid #ececec;
198
+ background: lightgray 50% / cover no-repeat;
199
+ height: 9.6rem;
200
+ width: 9.6rem;
201
+ @include min(tablet){
202
+ width: 10.8rem;
203
+ height: 10.8rem;
204
+ }
205
+ @include min(laptop) {
206
+ width: 12.4rem;
207
+ height: 12.4rem;
208
+ }
209
+ }
210
+ }
@@ -0,0 +1,97 @@
1
+ import React, { useContext } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { imagePrettyUrl, getAltText, translate } from '~helpers/getters';
4
+ import styles from './author-details.module.scss';
5
+ import LazyImage from '~hooks/lazy-image';
6
+ import socialIcons from '../icons/socialIcons';
7
+ import FactCheckIcon from '../../../../images/icons/fact-check';
8
+ import { Context } from '~context/MainProvider';
9
+
10
+ export default function AuthorDetails({
11
+ author,
12
+ width = 180,
13
+ height = 180,
14
+ verifiedIconWidth = 14,
15
+ verifiedIconHeight = 14,
16
+ template = '',
17
+ ribbon = false,
18
+ extraInfo = false,
19
+ }) {
20
+ const { translations } = useContext(Context) || {};
21
+ return (
22
+ <div className={`${styles.details || ''} ${styles[template]}`}>
23
+ {author?.image_object && (
24
+ <LazyImage
25
+ src={imagePrettyUrl(author?.image_object.filename, width, height)}
26
+ alt={getAltText(author?.image_object, author?.image_alt || author?.name)}
27
+ width={width}
28
+ height={height}
29
+ />
30
+ )}
31
+ <div className={styles.information || ''}>
32
+ <p className={styles.name || ''}>
33
+ <span>{author?.name}</span>
34
+ <FactCheckIcon width={verifiedIconWidth} height={verifiedIconHeight} color="#457BF9" />
35
+ </p>
36
+ <div className={styles.ribbonAndExpert}>
37
+ {author?.author_title && <p className={styles.title || ''}>{author?.author_title}</p>}
38
+ {author?.ribbon_label && ribbon && (
39
+ <div className={styles.ribbon || ''}>{author?.ribbon_label}</div>
40
+ )}
41
+ </div>
42
+ {socialIcons(author).length > 0 && (
43
+ <p className={styles.socialIcons || ''}>
44
+ {socialIcons(author)
45
+ .filter((socialLink) => socialLink.link)
46
+ .map((filteredLinks) => (
47
+ // eslint-disable-next-line jsx-a11y/control-has-associated-label
48
+ <a
49
+ href={filteredLinks.link}
50
+ className="author-gtm"
51
+ target="_blank"
52
+ rel="nofollow noreferrer"
53
+ key={`author-box-link-${filteredLinks.id}`}
54
+ aria-label={`${filteredLinks.id} Link`}
55
+ >
56
+ {filteredLinks.icon}
57
+ </a>
58
+ ))}
59
+ </p>
60
+ )}
61
+ {extraInfo && (author?.experience || author?.pages_count) && (
62
+ <div className={styles.authorStats}>
63
+ {author?.pages_count && (
64
+ <p>
65
+ <span>{author?.pages_count}</span>
66
+ {translate(translations, 'written_articles', 'Written articles')}
67
+ </p>
68
+ )}
69
+ {author?.experience && <p>{author?.experience}</p>}
70
+ </div>
71
+ )}
72
+ </div>
73
+ </div>
74
+ );
75
+ }
76
+
77
+ AuthorDetails.propTypes = {
78
+ author: PropTypes.shape({
79
+ image_object: PropTypes.shape({
80
+ filename: PropTypes.string,
81
+ }),
82
+ image_alt: PropTypes.string,
83
+ name: PropTypes.string,
84
+ author_title: PropTypes.string,
85
+ ribbon_label: PropTypes.string,
86
+ experience: PropTypes.string,
87
+ pages_count: PropTypes.string,
88
+ }),
89
+ width: PropTypes.number,
90
+ height: PropTypes.number,
91
+ verifiedIconWidth: PropTypes.number,
92
+ verifiedIconHeight: PropTypes.number,
93
+ socialIcons: PropTypes.shape({}),
94
+ template: PropTypes.string,
95
+ ribbon: PropTypes.bool,
96
+ extraInfo: PropTypes.bool,
97
+ };
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { FaInstagram } from '@react-icons/all-files/fa/FaInstagram';
3
+ import { FaFacebookSquare } from '@react-icons/all-files/fa/FaFacebookSquare';
4
+ import { IoLogoTiktok } from '@react-icons/all-files/io5/IoLogoTiktok';
5
+ import { FaLinkedin } from '@react-icons/all-files/fa/FaLinkedin';
6
+ import { FaWikipediaW } from '@react-icons/all-files/fa/FaWikipediaW';
7
+
8
+ export const TwitterIcon = () => (
9
+ <svg
10
+ width="1em"
11
+ height="1em"
12
+ viewBox="0 0 13 12"
13
+ fill="currentcolor"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ >
16
+ <path d="M9.97574 0H11.9181L7.67469 4.84989L12.6667 11.4495H8.75802L5.69659 7.44685L2.19363 11.4495H0.250147L4.78881 6.26203L0 0H4.0079L6.7752 3.65856L9.97574 0ZM9.29408 10.287H10.3703L3.42314 1.1015H2.26822L9.29408 10.287Z" />
17
+ </svg>
18
+ );
19
+
20
+ const socialIcons = {
21
+ facebook: <FaFacebookSquare title="Facebook Icon" />,
22
+ instagram: <FaInstagram title="Instagram Icon" />,
23
+ linkedin: <FaLinkedin title="Linkedin Icon" />,
24
+ twitter: <TwitterIcon />,
25
+ tiktok: <IoLogoTiktok title="Tiktok Icon" />,
26
+ wikipedia: <FaWikipediaW title="Wikipedia" />,
27
+ };
28
+
29
+ export default (author) => [
30
+ { id: 'fb', link: author?.facebook_profile, icon: socialIcons?.facebook },
31
+ { id: 'ig', link: author?.instagram_profile, icon: socialIcons?.instagram },
32
+ { id: 'li', link: author?.linkedin_profile, icon: socialIcons?.linkedin },
33
+ { id: 'tw', link: author?.twitter_profile, icon: socialIcons?.twitter },
34
+ { id: 'tt', link: author?.tik_tok, icon: socialIcons?.tiktok },
35
+ { id: 'wk', link: author?.personal_website, icon: socialIcons?.wikipedia },
36
+ ];