Skip to content

Commit 11d69f3

Browse files
authored
add external icon for external link CTA buttons (#57997)
1 parent 4654315 commit 11d69f3

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/landings/components/shared/LandingHero.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { LinkExternalIcon } from '@primer/octicons-react'
12
import styles from './LandingHero.module.scss'
23
import { useTranslation } from '@/languages/components/useTranslation'
34

@@ -41,15 +42,25 @@ export const LandingHero = ({ title, intro, heroImage, introLinks }: LandingHero
4142
href={primaryAction[1]}
4243
className={`${styles.heroAction} ${styles.heroPrimaryAction}`}
4344
>
44-
{t(primaryAction[0])}
45+
{t(primaryAction[0])}{' '}
46+
{primaryAction[1].startsWith('https') && (
47+
<span className="ml-1">
48+
<LinkExternalIcon aria-label="(external site)" size="small" />
49+
</span>
50+
)}
4551
</a>
4652
)}
4753
{secondaryAction && (
4854
<a
4955
href={secondaryAction[1]}
5056
className={`${styles.heroAction} ${styles.heroSecondaryAction}`}
5157
>
52-
{t(secondaryAction[0])}
58+
{t(secondaryAction[0])}{' '}
59+
{secondaryAction[1].startsWith('https') && (
60+
<span className="ml-1">
61+
<LinkExternalIcon aria-label="(external site)" size="small" />
62+
</span>
63+
)}
5364
</a>
5465
)}
5566
</div>

0 commit comments

Comments
 (0)