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

DS-510 Simplify the LinkBase implementation #200

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gregaubert
Copy link
Member

I suggest we change linkbase to a simpler implementation where we extract the navlink part that is just for the DropdownMenuItemLink. It also allows to fully rely on the shouldOpenInNewTab props to display the external icon or not.

Copy link

netlify bot commented Oct 9, 2024

Deploy Preview for echoes-react ready!

Name Link
🔨 Latest commit 0c2ce58
🔍 Latest deploy log https://app.netlify.com/sites/echoes-react/deploys/6706a9b58855df0008f62b8d
😎 Deploy Preview https://deploy-preview-200--echoes-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

LinkBaseProps,
'download' | 'hasExternalIcon' | 'isMatchingFullPath' | 'shouldOpenInNewTab' | 'to'
> & { hasExternalIcon?: boolean } & Pick<
DropdownMenuItemNavLinkProps,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NP: I would have expected to see DropdownMenuItemNavLinkProps defined before it is used - maybe move the type(s) up?

{...restAndRadixProps}
onClick={handleClick}
ref={ref}
style={style}
to={to}>
{children}
</RouterLinkComponent>

{shouldOpenInNewTabProps && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NP: this would look better IMO as {shouldOpenInNewTab && (

to={to}>
{children}

{shouldOpenInNewTabProps && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NP: this would look better IMO as {shouldOpenInNewTab && (

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