gatsby-core-theme 30.0.101 → 30.0.103

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,25 @@
1
+ ## [30.0.103](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.102...v30.0.103) (2024-03-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update translations ([d64c057](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d64c057fe2f43a79ad4701a18ab5ab8b0e187720))
7
+
8
+
9
+ * Merge branch 'tm-4159-author-box' into 'master' ([dc5e875](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/dc5e8752a92f2ccfecc71109e561de8601c8dc81))
10
+
11
+ ## [30.0.102](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.101...v30.0.102) (2024-03-19)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * remove extra e word ([b338d74](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b338d746fdee9bcff3746dfc890f3618b01e6841))
17
+ * update author box ([75ef3b6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/75ef3b6fe4165835c8e74e3a5c31230a7d84bf6f))
18
+ * update the typo on the name ([d3e5185](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d3e5185178d2abeaff9c90c50889d4837fba4a1f))
19
+
20
+
21
+ * Merge branch 'tm-4159-author-box' into 'master' ([a50cc37](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a50cc371a92b8d7c8e85409d89015cda9667447f))
22
+
1
23
  ## [30.0.101](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.100...v30.0.101) (2024-03-18)
2
24
 
3
25
 
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.103",
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, 'toggle_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
  };