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

Externe link component #448

Closed
Robbert opened this issue Jul 29, 2024 · 1 comment · Fixed by #520
Closed

Externe link component #448

Robbert opened this issue Jul 29, 2024 · 1 comment · Fixed by #520
Assignees

Comments

@Robbert
Copy link
Member

Robbert commented Jul 29, 2024

Waarschijnlijk het handigst een wrapper te maken van de Utrecht Link met jullie externe link functionaliteit als extra feature.

  • Gebruik de wrapper van Utrecht als je een externe link icoon hebt
  • Let op de accessibility van icon, moet wel text-equivalent hebben
  • external prop gebruiken (en weer doorgeven aan Utrecht Link) voor privacy en noreferrer enzo

Link.tsx aanmaken in deze component library voor React:

import { Link as UtrechtLink, type LinkProps as UtrechtLinkProps } from '@utrecht/component-library-react/dist/css-module';

interface RhcLinkProps extends UtrechtLinkProps {
  externalLabel?: string;
}

export const Link = forwardRef(
  (({ externalLabel, ...restProps}: RhcLinkProps, ref: ForwaredRef<HTMLAnchorElement>) => <UtrechtLink {...restProps} ref={ref}>{restProps.external && <Icon role="img" aria-label={externalLabel}><ExternalIconSVG/></Icon>}{children}</Link>);

index.ts:

export * from '@utrecht/component-library-react/dist/css-module';

// Overwrite some components
export { Link } from './Link';

Voorbeeld van een wrapper van UtrechtLink voor Next.js: https://github.com/frameless/strapi/blob/main/packages/ui/src/components/AdvancedLink/index.tsx

Figma
Link component in NLDS - Rijksoverheid - Bibliotheek

@Robbert Robbert converted this from a draft issue Jul 29, 2024
@Robbert Robbert mentioned this issue Jul 31, 2024
20 tasks
@Rerbun Rerbun self-assigned this Aug 7, 2024
@Rerbun Rerbun mentioned this issue Aug 7, 2024
@Rerbun Rerbun closed this as completed in 6a6c906 Aug 19, 2024
MeesD94 pushed a commit that referenced this issue Aug 22, 2024
Closes #474 
Closes #448

---------

Co-authored-by: Ruben Smit <[email protected]>
@AlineNap AlineNap moved this from Done to Design review in Community Sprint - Rijkshuisstijl componenten Sep 3, 2024
@AlineNap AlineNap assigned AlineNap and unassigned Rerbun Sep 3, 2024
@AlineNap
Copy link
Contributor

AlineNap commented Sep 6, 2024

Zie feedback in link story: #474 (comment)

AdhamAH pushed a commit that referenced this issue Sep 11, 2024
closes #474 and #448

Changes are based on feedback:
#474 (comment)

---------

Co-authored-by: Ruben Smit <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants