Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

olmoh
Copy link
Collaborator

@olmoh olmoh commented Mar 10, 2025

Moves app specific logic from Link component to two separate components, ExternalLink and InternalLink.


This change is Reviewable

Copy link

linear bot commented Mar 10, 2025

@olmoh olmoh marked this pull request as ready for review March 10, 2025 09:25
@olmoh olmoh requested a review from tobias-jarvelov March 10, 2025 09:25
@olmoh olmoh changed the title Add support for external links in link component des 1826 Add support for external links in link component Mar 10, 2025
color={color}
$hoverColor={getHoverColor(color)}
{...props}>
<StyledText forwardedAs={as ?? 'a'} color={color} $hoverColor={getHoverColor(color)} {...props}>
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

@olmoh olmoh force-pushed the add-support-for-external-links-in-link-component-des-1826 branch from e262683 to 33a94e0 Compare March 11, 2025 09:57
@olmoh olmoh requested a review from tobias-jarvelov March 11, 2025 10:04
@olmoh olmoh force-pushed the add-support-for-external-links-in-link-component-des-1826 branch from 33a94e0 to 218471d Compare March 11, 2025 11:59
@olmoh olmoh force-pushed the add-support-for-external-links-in-link-component-des-1826 branch from 218471d to 15a72ef Compare March 11, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants