diff --git a/src/view/com/Button.tsx b/src/view/com/Button.tsx index 1d858a8eea..7b3beb7dca 100644 --- a/src/view/com/Button.tsx +++ b/src/view/com/Button.tsx @@ -5,6 +5,7 @@ import { PressableProps, TextProps, ViewStyle, + AccessibilityProps, } from 'react-native' import {useTheme, atoms, tokens, web, native} from '#/alf' @@ -22,7 +23,10 @@ export type VariantProps = { size?: ButtonSize } -export type ButtonProps = Omit & +export type ButtonProps = Omit< + PressableProps, + 'children' | 'style' | 'accessibilityLabel' | 'accessibilityHint' +> & VariantProps & { children: | ((props: { @@ -37,14 +41,17 @@ export type ButtonProps = Omit & }) => React.ReactNode) | React.ReactNode | string + accessibilityLabel: Required['accessibilityLabel'] + accessibilityHint: Required['accessibilityHint'] } export type ButtonTextProps = TextProps & VariantProps & {disabled?: boolean} export function Button({ children, - style, type, size, + accessibilityLabel, + accessibilityHint, disabled = false, ...rest }: ButtonProps) { @@ -179,6 +186,9 @@ export function Button({ () - const {href, accessibilityRole} = useLinkProps({ + const {href} = useLinkProps({ to: typeof to === 'string' ? convertBskyAppUrlIfNeeded(sanitizeUrl(to)) : to, }) @@ -139,9 +139,9 @@ export function Link({ return ( + - - - - - - External - +

External with custom children

https://blueskyweb.xyz Internal - + {({props}) => Link as a button}