-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for external links in link component #7784
base: main
Are you sure you want to change the base?
Add support for external links in link component #7784
Conversation
...llvad-vpn/src/renderer/lib/components/navigation-header/components/NavigationHeaderTitle.tsx
Outdated
Show resolved
Hide resolved
desktop/packages/mullvad-vpn/src/renderer/lib/components/typography/Text.tsx
Outdated
Show resolved
Hide resolved
color={color} | ||
$hoverColor={getHoverColor(color)} | ||
{...props}> | ||
<StyledText forwardedAs={as ?? 'a'} color={color} $hoverColor={getHoverColor(color)} {...props}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Couldn't we set the default value for the as
prop in the destructuring of the Link's props?
export const Link = <T extends WebTarget = 'a'>({
as = 'a',
children,
...
<StyledText forwardedAs={as} ...
I seem to recall this being a pattern we've used previously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is indeed more in line with how we do in it other places so makes sense to do it here as well. Had to cast it here though to make the types happy.
desktop/packages/mullvad-vpn/src/renderer/lib/components/typography/Text.tsx
Show resolved
Hide resolved
desktop/packages/mullvad-vpn/src/renderer/lib/components/typography/Link.tsx
Outdated
Show resolved
Hide resolved
desktop/packages/mullvad-vpn/src/renderer/lib/components/typography/FootnoteMini.tsx
Outdated
Show resolved
Hide resolved
e262683
to
33a94e0
Compare
33a94e0
to
218471d
Compare
218471d
to
15a72ef
Compare
Moves app specific logic from
Link
component to two separate components,ExternalLink
andInternalLink
.This change is