gatsby-core-theme 30.0.100 → 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,24 @@
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
+
13
+ ## [30.0.101](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.100...v30.0.101) (2024-03-18)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * remove dashes ([6d8b3d3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6d8b3d30ce165545fa4ad27f2d1ec821d046f28a))
19
+ * remove dashes on anchor href ([2945dfe](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2945dfe81f6a6f76086793d92e7905023f705008))
20
+ * revert anchor ([db1fe54](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/db1fe5414c02096dd274bf3d637205e479c5a852))
21
+
1
22
  ## [30.0.100](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.99...v30.0.100) (2024-03-14)
2
23
 
3
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "30.0.100",
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
  };
@@ -13,7 +13,7 @@ describe('Anchor Component', () => {
13
13
  expect(container.querySelectorAll('a')).toHaveLength(2);
14
14
  expect(getByText('label-1')).toBeTruthy();
15
15
  expect(getByText('label-2')).toBeTruthy();
16
- expect(getByText('label-2').getAttribute('href')).toEqual('#label-2');
16
+ expect(getByText('label-2').getAttribute('href')).toEqual('#label2');
17
17
  });
18
18
  test('on click', async () => {
19
19
  const module = getListCarouselItem(4);
@@ -8,7 +8,6 @@ import PropTypes from 'prop-types';
8
8
  import { IoIosArrowBack } from '@react-icons/all-files/io/IoIosArrowBack';
9
9
  import { IoIosArrowForward } from '@react-icons/all-files/io/IoIosArrowForward';
10
10
  import isSticky from '~hooks/stickyOnScroll';
11
- import ScollX from '../../../../hooks/scroll-x';
12
11
  import keygen from '~helpers/keygen';
13
12
  import { anchorLink, removeSymbols } from '~helpers/strings';
14
13
  import { translate } from '~helpers/getters';
@@ -13,7 +13,7 @@ describe('Anchor Component', () => {
13
13
  expect(container.querySelectorAll('a')).toHaveLength(2);
14
14
  expect(getByText('label-1')).toBeTruthy();
15
15
  expect(getByText('label-2')).toBeTruthy();
16
- expect(getByText('label-2').getAttribute('href')).toEqual('#label-2');
16
+ expect(getByText('label-2').getAttribute('href')).toEqual('#label2');
17
17
  });
18
18
  test('on click', async () => {
19
19
  const module = getListCarouselItem(4);
@@ -6,7 +6,7 @@ export function capitalize(string) {
6
6
  }
7
7
 
8
8
  export function anchorLink(string) {
9
- return string.replace(/\s/g, '-').toLowerCase();
9
+ return string.replace('-', '').replace(/\s/g, '-').toLowerCase();
10
10
  }
11
11
 
12
12
  // export function getLinkListFromPath(path) {