gatsby-core-theme 30.0.85 → 30.0.87

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,26 @@
1
+ ## [30.0.87](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.86...v30.0.87) (2024-02-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add continue reading ([ca3f8f6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/ca3f8f61994430fbeca59b6d5416353232ba169c))
7
+ * add image as well ([aa901ce](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/aa901ceaf43ed2a246f6b4b98f0cab73df7601dc))
8
+ * update tests ([4033148](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4033148d8f5b1848031a309006d92252c9c70bba))
9
+
10
+
11
+ * Merge branch 'tm-3980-author-box' into 'master' ([8f72950](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8f72950a5ea153c3a27a47ee91afe804604beaee))
12
+
13
+ ## [30.0.86](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.85...v30.0.86) (2024-02-22)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * used phonenum for helpline ([00ac2d5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/00ac2d5dc62314c76aadf2b09cbe7d92b2ceb5ef))
19
+
20
+
21
+ * Merge branch 'tm-4047-market-helpline' into 'master' ([d2ae2b3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d2ae2b3a4399146c9e4f501d18a99e63007edcbf))
22
+ * Merge remote-tracking branch 'origin' into tm-4047-market-helpline ([713c588](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/713c588b487c531740c9519fdd703b01d464ef69))
23
+
1
24
  ## [30.0.85](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.84...v30.0.85) (2024-02-21)
2
25
 
3
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "30.0.85",
3
+ "version": "30.0.87",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -4,7 +4,7 @@
4
4
  align-self: stretch;
5
5
  position: relative;
6
6
  margin-bottom: 1rem;
7
- @include min(laptop){
7
+ @include min(laptop) {
8
8
  grid-column: 2/3;
9
9
  grid-row: 1/2;
10
10
  }
@@ -15,13 +15,36 @@
15
15
  bottom: 0;
16
16
  }
17
17
 
18
+ .contReadText {
19
+ text-decoration: underline;
20
+ }
21
+
18
22
  .biography {
19
23
  font-size: 1.4rem;
20
24
  line-height: 2.2rem;
21
25
  color: #515156;
22
26
  margin-bottom: 1.6rem;
23
- @include min(laptop){
24
- margin-bottom: .8rem;
27
+ @include min(laptop) {
28
+ margin-bottom: 0.8rem;
29
+ }
30
+
31
+ &.showReadMore {
32
+ max-height: 88px;
33
+ min-height: 66px;
34
+ overflow: hidden;
35
+ transition: max-height 0s ease-out;
36
+ cursor: pointer;
37
+
38
+ @include max(mobile) {
39
+ max-height: 110px;
40
+ }
41
+
42
+ &.open {
43
+ max-height: 2000px;
44
+ transition: max-height 0s ease-in;
45
+ cursor: default;
46
+ pointer-events: none;
47
+ }
25
48
  }
26
49
 
27
50
  p {
@@ -44,8 +67,8 @@
44
67
  text-transform: capitalize;
45
68
  }
46
69
 
47
- .templateTwo{
48
- @include min(tablet){
49
- padding-left:13rem;
70
+ .templateTwo {
71
+ @include min(tablet) {
72
+ padding-left: 13rem;
50
73
  }
51
74
  }
@@ -1,4 +1,4 @@
1
- import React, { useContext, useRef } from 'react';
1
+ import React, { useContext, useRef, useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
4
4
  import { translate } from '~helpers/getters';
@@ -13,14 +13,32 @@ export default function AuthorDescription({
13
13
  }) {
14
14
  const { translations } = useContext(Context) || {};
15
15
  const biographyRef = useRef(null);
16
+ const [isReadMore, setIsReadMore] = useState(true);
17
+
18
+ const toggleReadMore = () => {
19
+ biographyRef.current.classList.add(styles.open);
20
+ setIsReadMore(false);
21
+ };
16
22
 
17
23
  return (
18
24
  <div className={`${styles.description || ''} ${styles[template]}`}>
19
25
  <div
20
26
  ref={biographyRef}
21
- className={`${styles.biography}`}
27
+ className={`${styles.biography} ${
28
+ author?.biography?.split(' ').length > 30 && styles.showReadMore
29
+ }`}
30
+ role="button"
31
+ aria-label="Toggle biography read more"
32
+ tabIndex={0}
33
+ onClick={toggleReadMore}
34
+ onKeyDown={toggleReadMore}
22
35
  dangerouslySetInnerHTML={{
23
- __html: author?.biography,
36
+ __html:
37
+ author?.biography?.split(' ').length > 30 && isReadMore
38
+ ? `${author?.biography?.split(' ').slice(0, 30).join(' ')} <span class='${
39
+ styles.contReadText
40
+ }'>...${translate(translations, 'cont_read', 'continue reading')}</span>`
41
+ : author?.biography,
24
42
  }}
25
43
  />
26
44
  {author?.profile_page_path && (
@@ -4,6 +4,7 @@ import { FaFacebookSquare } from '@react-icons/all-files/fa/FaFacebookSquare';
4
4
  import { IoLogoTiktok } from '@react-icons/all-files/io5/IoLogoTiktok';
5
5
  import { FaLinkedin } from '@react-icons/all-files/fa/FaLinkedin';
6
6
  import { FaWikipediaW } from '@react-icons/all-files/fa/FaWikipediaW';
7
+ import { FaRegEnvelope } from '@react-icons/all-files/fa/FaRegEnvelope';
7
8
 
8
9
  export const TwitterIcon = () => (
9
10
  <svg
@@ -24,6 +25,7 @@ const socialIcons = {
24
25
  twitter: <TwitterIcon />,
25
26
  tiktok: <IoLogoTiktok title="Tiktok Icon" />,
26
27
  wikipedia: <FaWikipediaW title="Wikipedia" />,
28
+ message: <FaRegEnvelope title="Envelope icon" />,
27
29
  };
28
30
 
29
31
  export default (author) => [
@@ -33,4 +35,5 @@ export default (author) => [
33
35
  { id: 'tw', link: author?.twitter_profile, icon: socialIcons?.twitter },
34
36
  { id: 'tt', link: author?.tik_tok, icon: socialIcons?.tiktok },
35
37
  { id: 'wk', link: author?.personal_website, icon: socialIcons?.wikipedia },
38
+ { id: 'em', link: author?.email_address, icon: socialIcons?.message },
36
39
  ];
@@ -21,7 +21,7 @@ describe('author box component', () => {
21
21
  const author = authorObject;
22
22
 
23
23
  author.biography =
24
- "The purpose of lorem ipsum is to create a natural looking block of text (sentence, paragraph, page, etc.) that doesn't distract from the layout. A practice not without controversy, laying out";
24
+ "The purpose of lorem ipsum is to create a natural looking block of text (sentence, paragraph, page, etc.) that doesn't distract from the layout";
25
25
 
26
26
  const { container, getByText } = render(<AuthorBox author={author} />);
27
27
 
@@ -21,7 +21,7 @@ describe('author box component', () => {
21
21
  const author = authorObject;
22
22
 
23
23
  author.biography =
24
- "The purpose of lorem ipsum is to create a natural looking block of text (sentence, paragraph, page, etc.) that doesn't distract from the layout. A practice not without controversy, laying out";
24
+ "The purpose of lorem ipsum is to create a natural looking block of text (sentence, paragraph, page, etc.) that doesn't distract from the layout.";
25
25
 
26
26
  const { container, getByText } = render(<AuthorBox author={author} />);
27
27
 
@@ -21,7 +21,7 @@ describe('author box component', () => {
21
21
  const author = authorObject;
22
22
 
23
23
  author.biography =
24
- "The purpose of lorem ipsum is to create a natural looking block of text (sentence, paragraph, page, etc.) that doesn't distract from the layout. A practice not without controversy, laying out";
24
+ "The purpose of lorem ipsum is to create a natural looking block of text (sentence, paragraph, page, etc.) that doesn't distract from the layout.";
25
25
 
26
26
  const { container, getByText } = render(<AuthorBox author={author} />);
27
27
 
@@ -38,7 +38,6 @@ const Footer = (props) => {
38
38
  </a>
39
39
  in order to get help.
40
40
  </p>`;
41
- const phoneNum = '- 89 241 5401';
42
41
 
43
42
  const footerLogos = getExtraField(props.section?.extra_fields, 'logos');
44
43
 
@@ -75,8 +74,8 @@ const Footer = (props) => {
75
74
  dmcaWidth: 100,
76
75
  dmcaHeight: 30,
77
76
  securityIcon: '../../../images/security.svg',
78
- helpText: getExtraField(props.section?.extra_fields, 'helpline') || helpText,
79
- phoneNum,
77
+ helpText,
78
+ phoneNum: getExtraField(props.section?.extra_fields, 'helpline') || null,
80
79
  };
81
80
 
82
81
  return footerContent(props);