Skip to content

Commit

Permalink
Add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
robintown committed Sep 12, 2024
1 parent e5e6233 commit 3ded8be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/button/Link.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ Please see LICENSE in the repository root for full details.
*/

.external {
/* By default links will be blue/purple (or whatever the user agent does), but
in our designs we generally want external links to be the same color as the
surrounding text */
color: inherit;
}
5 changes: 5 additions & 0 deletions src/button/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type Props = Omit<

/**
* A version of Compound's link component that integrates with our router setup.
* This is only for app-internal links.
*/
export const Link = forwardRef<HTMLAnchorElement, Props>(function Link(
{ to, state, ...props },

Check warning on line 54 in src/button/Link.tsx

View check run for this annotation

Codecov / codecov/patch

src/button/Link.tsx#L54

Added line #L54 was not covered by tests
Expand All @@ -57,6 +58,10 @@ export const Link = forwardRef<HTMLAnchorElement, Props>(function Link(
return <CpdLink ref={ref} {...props} href={path} onClick={onClick} />;
});

/**
* A link to an external web page, made to fit into blocks of text more subtly
* than the normal Compound link component.
*/
export const ExternalLink = forwardRef<
HTMLAnchorElement,
ComponentPropsWithoutRef<"a">
Expand Down

0 comments on commit 3ded8be

Please sign in to comment.