Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/site/components/withBadgeGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const WithBadgeGroup: FC<{ section: string }> = ({ section }) => {
badgeText={badge.title}
kind={badge.kind}
href={badge.link}
// Ensure that External Links have a target="_blank" and an arrow icon
// indicating that the link is external and should open in a new tab
target={/^https?:/.test(badge.link) ? '_blank' : undefined}
>
{badge.text}
</BadgeGroup>
Expand Down
4 changes: 2 additions & 2 deletions apps/site/pages/en/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ layout: home
<WithNodeRelease status="Active LTS">
{({ release }) =>
<BadgeGroup size="small" kind="info" badgeText={release.versionWithPrefix} href={`/blog/release/${release.versionWithPrefix}`}>
Node.js LTS
Latest LTS
</BadgeGroup>}
</WithNodeRelease>

<WithNodeRelease status="Current">
{({ release }) =>
<BadgeGroup size="small" badgeText={release.versionWithPrefix} href={`/blog/release/${release.versionWithPrefix}`}>
Node.js Current
Latest Release
</BadgeGroup>}
</WithNodeRelease>
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-components/src/Common/BadgeGroup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ArrowRightIcon from '@heroicons/react/24/solid/ArrowRightIcon';
import ArrowUpRightIcon from '@heroicons/react/24/solid/ArrowUpRightIcon';
import type { ComponentProps, FC, PropsWithChildren } from 'react';

import Badge from '#ui/Common/Badge';
Expand Down Expand Up @@ -30,7 +30,7 @@ const BadgeGroup: FC<PropsWithChildren<BadgeGroupProps>> = ({

<span className={styles.message}>{children}</span>

{args.href && <ArrowRightIcon className={styles.icon} />}
{args.target === '_blank' && <ArrowUpRightIcon className={styles.icon} />}
</Component>
);

Expand Down
Loading