File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
packages/ui-components/src/Common/BadgeGroup Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ const WithBadgeGroup: FC<{ section: string }> = ({ section }) => {
1515 badgeText = { badge . title }
1616 kind = { badge . kind }
1717 href = { badge . link }
18+ // Ensure that External Links have a target="_blank" and an arrow icon
19+ // indicating that the link is external and should open in a new tab
20+ target = { / ^ h t t p s ? : / . test ( badge . link ) ? '_blank' : undefined }
1821 >
1922 { badge . text }
2023 </ BadgeGroup >
Original file line number Diff line number Diff line change @@ -31,14 +31,14 @@ layout: home
3131 <WithNodeRelease status = " Active LTS" >
3232 { ({ release }) =>
3333 <BadgeGroup size = " small" kind = " info" badgeText = { release .versionWithPrefix } href = { ` /blog/release/${release .versionWithPrefix } ` } >
34- Node.js LTS
34+ Latest LTS
3535 </BadgeGroup >}
3636 </WithNodeRelease >
3737
3838 <WithNodeRelease status = " Current" >
3939 { ({ release }) =>
4040 <BadgeGroup size = " small" badgeText = { release .versionWithPrefix } href = { ` /blog/release/${release .versionWithPrefix } ` } >
41- Node.js Current
41+ Latest Release
4242 </BadgeGroup >}
4343 </WithNodeRelease >
4444 </div >
Original file line number Diff line number Diff line change 1- import ArrowRightIcon from '@heroicons/react/24/solid/ArrowRightIcon ' ;
1+ import ArrowUpRightIcon from '@heroicons/react/24/solid/ArrowUpRightIcon ' ;
22import type { ComponentProps , FC , PropsWithChildren } from 'react' ;
33
44import Badge from '#ui/Common/Badge' ;
@@ -30,7 +30,7 @@ const BadgeGroup: FC<PropsWithChildren<BadgeGroupProps>> = ({
3030
3131 < span className = { styles . message } > { children } </ span >
3232
33- { args . href && < ArrowRightIcon className = { styles . icon } /> }
33+ { args . target === '_blank' && < ArrowUpRightIcon className = { styles . icon } /> }
3434 </ Component >
3535) ;
3636
You can’t perform that action at this time.
0 commit comments