diff options
author | Eric Bailey <git@esb.lol> | 2024-07-25 18:34:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-25 18:34:21 -0500 |
commit | 43ba0f21f6796ebbdd0156c9fa89ebc7d56376e7 (patch) | |
tree | c4ef254ef49e541b724e87203591d141a81f2172 /src/components/Link.tsx | |
parent | 4437b9a55782ac4b213fb209f52378b839329c2a (diff) | |
download | voidsky-43ba0f21f6796ebbdd0156c9fa89ebc7d56376e7.tar.zst |
Make label required in link components (#4844)
Diffstat (limited to 'src/components/Link.tsx')
-rw-r--r-- | src/components/Link.tsx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/components/Link.tsx b/src/components/Link.tsx index a8b478be7..6c25faffb 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -41,11 +41,6 @@ type BaseLinkProps = Pick< testID?: string /** - * Label for a11y. Defaults to the href. - */ - label?: string - - /** * The React Navigation `StackAction` to perform when the link is pressed. */ action?: 'push' | 'replace' | 'navigate' @@ -197,7 +192,7 @@ export function useLink({ } export type LinkProps = Omit<BaseLinkProps, 'disableMismatchWarning'> & - Omit<ButtonProps, 'onPress' | 'disabled' | 'label'> + Omit<ButtonProps, 'onPress' | 'disabled'> /** * A interactive element that renders as a `<a>` tag on the web. On mobile it @@ -224,7 +219,6 @@ export function Link({ return ( <Button - label={href} {...rest} style={[a.justify_start, flatten(rest.style)]} role="link" @@ -249,7 +243,8 @@ export function Link({ export type InlineLinkProps = React.PropsWithChildren< BaseLinkProps & TextStyleProp & Pick<TextProps, 'selectable'> -> +> & + Pick<ButtonProps, 'label'> export function InlineLinkText({ children, @@ -291,7 +286,7 @@ export function InlineLinkText({ <Text selectable={selectable} accessibilityHint="" - accessibilityLabel={label || href} + accessibilityLabel={label} {...rest} style={[ {color: t.palette.primary_500}, |