Skip to content

Commit

Permalink
feat: Add OnLongPress prop to Button component (#2339)
Browse files Browse the repository at this point in the history
  • Loading branch information
ja-rojas03 committed Nov 10, 2020
1 parent ee9de5e commit 2267aba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ type Props = React.ComponentProps<typeof Surface> & {
* Function to execute on press.
*/
onPress?: () => void;
/**
* Function to execute on long press.
*/
onLongPress?: () => void;
/**
* Style of button's inner content.
* Use this prop to apply custom height and width.
Expand Down Expand Up @@ -129,6 +133,7 @@ const Button = ({
uppercase = true,
accessibilityLabel,
onPress,
onLongPress,
style,
theme,
contentStyle,
Expand Down Expand Up @@ -251,6 +256,7 @@ const Button = ({
borderless
delayPressIn={0}
onPress={onPress}
onLongPress={onLongPress}
onPressIn={handlePressIn}
onPressOut={handlePressOut}
accessibilityLabel={accessibilityLabel}
Expand Down

0 comments on commit 2267aba

Please sign in to comment.