Skip to content

Commit

Permalink
change duplicate variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
LilyL0u committed Nov 12, 2024
1 parent d401bbb commit 6e04892
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/components/JumpTo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ const JumpTo = ({ jumpToHeadings, showRelatedContentLink }: JumpToProps) => {
</Text>
<ol role="list" css={styles.list}>
{jumpToHeadings?.map(({ heading, sanitisedId }) => {
sanitisedId = sanitisedId || idSanitiser(heading);
const idWithHash = `#${sanitisedId}`;
const id = sanitisedId || idSanitiser(heading);
const idWithHash = `#${id}`;
const isActiveId = decodeURIComponent(hash) === idWithHash;
return (
<li key={idWithHash} css={styles.listItem}>
<a
href={idWithHash}
onClick={e => linkClickHandler(e, idWithHash)}
css={styles.link}
data-testid={`jump-to-link-${sanitisedId}`}
data-testid={`jump-to-link-${id}`}
>
<span
css={[styles.linkText, isActiveId && styles.linkTextActive]}
Expand Down

0 comments on commit 6e04892

Please sign in to comment.