gatsby-core-theme 30.0.101 → 30.0.102

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,15 @@
1
+ ## [30.0.102](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.101...v30.0.102) (2024-03-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * remove extra e word ([b338d74](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b338d746fdee9bcff3746dfc890f3618b01e6841))
7
+ * update author box ([75ef3b6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/75ef3b6fe4165835c8e74e3a5c31230a7d84bf6f))
8
+ * update the typo on the name ([d3e5185](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d3e5185178d2abeaff9c90c50889d4837fba4a1f))
9
+
10
+
11
+ * Merge branch 'tm-4159-author-box' into 'master' ([a50cc37](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a50cc371a92b8d7c8e85409d89015cda9667447f))
12
+
1
13
  ## [30.0.101](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.100...v30.0.101) (2024-03-18)
2
14
 
3
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "30.0.101",
3
+ "version": "30.0.102",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -11,10 +11,11 @@ export default function AuthorDescription({
11
11
  contReadIcon = <FaArrowRight title="Right-pointing Arrow Icon" />,
12
12
  template = '',
13
13
  readMore = false,
14
+ maximumLength = 30,
14
15
  }) {
15
16
  const { translations } = useContext(Context) || {};
16
17
  const biographyRef = useRef(null);
17
- const [isReadMore, setIsReadMore] = useState(false);
18
+ const [isReadMore, setIsReadMore] = useState(true);
18
19
 
19
20
  const toggleReadMore = () => {
20
21
  biographyRef.current.classList.add(styles.open);
@@ -26,7 +27,9 @@ export default function AuthorDescription({
26
27
  <div
27
28
  ref={biographyRef}
28
29
  className={`${styles.biography} ${
29
- author?.biography?.split(' ').length > 30 && readMore ? styles.showReadMore : ''
30
+ author?.biography?.split(' ').length > maximumLength && readMore
31
+ ? styles.showReadMore
32
+ : ''
30
33
  }`}
31
34
  role="button"
32
35
  aria-label="Toggle biography read more"
@@ -35,10 +38,10 @@ export default function AuthorDescription({
35
38
  onKeyDown={toggleReadMore}
36
39
  dangerouslySetInnerHTML={{
37
40
  __html:
38
- author?.biography?.split(' ').length > 30 && isReadMore
39
- ? `${author?.biography?.split(' ').slice(0, 30).join(' ')} <span class='${
41
+ author?.biography?.split(' ').length > maximumLength && isReadMore
42
+ ? `${author?.biography?.split(' ').slice(0, maximumLength).join(' ')} <span class='${
40
43
  styles.contReadText
41
- }'>...${translate(translations, 'cont_read', 'continue reading')}</span>`
44
+ }'>${translate(translations, 'cont_read', '...continue reading')}</span>`
42
45
  : author?.biography,
43
46
  }}
44
47
  />
@@ -66,4 +69,5 @@ AuthorDescription.propTypes = {
66
69
  contReadIcon: PropTypes.node,
67
70
  template: PropTypes.string,
68
71
  readMore: PropTypes.bool,
72
+ maximumLength: PropTypes.number,
69
73
  };