Skip to content

Commit

Permalink
feat: add accessibilityHint prop to Button component (#1418)
Browse files Browse the repository at this point in the history
Signed-off-by: ZouidiSamih <[email protected]>
  • Loading branch information
ZouidiSamih authored Jan 30, 2025
1 parent 3819aec commit c7903a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/legacy/core/App/components/buttons/Button-api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface ButtonProps extends React.PropsWithChildren {
title: string
buttonType: ButtonType
accessibilityLabel?: string
accessibilityHint?: string
testID?: string
onPress?: () => void
disabled?: boolean
Expand Down
3 changes: 2 additions & 1 deletion packages/legacy/core/App/components/buttons/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useTheme } from '../../contexts/theme'
import { Button, ButtonType, ButtonProps } from './Button-api'

const ButtonImplComponent = (
{ title, buttonType, accessibilityLabel, testID, onPress, disabled = false, children }: ButtonProps,
{ title, buttonType, accessibilityLabel, accessibilityHint, testID, onPress, disabled = false, children }: ButtonProps,
ref: React.LegacyRef<TouchableOpacity>
) => {
const { Buttons, heavyOpacity } = useTheme()
Expand All @@ -25,6 +25,7 @@ const ButtonImplComponent = (
onPress={onPress}
accessible
accessibilityLabel={accessibilityLabel}
accessibilityHint={accessibilityHint}
accessibilityRole={'button'}
onPressIn={() => setIsActive(!disabled && true)}
onPressOut={() => setIsActive(false)}
Expand Down

0 comments on commit c7903a4

Please sign in to comment.