From 9f27af619918549d1c1decd048d5832b938ff32a Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Wed, 14 Dec 2022 15:46:21 -0600 Subject: Add haptic feedback to likes and reposts --- src/view/com/util/PostCtrls.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/view/com/util/PostCtrls.tsx b/src/view/com/util/PostCtrls.tsx index b981cc1bf..b15017237 100644 --- a/src/view/com/util/PostCtrls.tsx +++ b/src/view/com/util/PostCtrls.tsx @@ -1,6 +1,14 @@ import React from 'react' -import {Animated, StyleSheet, Text, TouchableOpacity, View} from 'react-native' +import { + Animated, + StyleSheet, + Text, + TouchableOpacity, + View, + Vibration, +} from 'react-native' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' +import ReactNativeHapticFeedback from 'react-native-haptic-feedback' import {UpIcon, UpIconSolid} from '../../lib/icons' import {s, colors} from '../../lib/styles' import {useAnimatedValue} from '../../lib/useAnimatedValue' @@ -56,6 +64,7 @@ export function PostCtrls(opts: PostCtrlsOpts) { const onPressToggleRepostWrapper = () => { if (!opts.isReposted) { + ReactNativeHapticFeedback.trigger('impactMedium') Animated.sequence([ Animated.timing(interp1, { toValue: 1, @@ -74,6 +83,7 @@ export function PostCtrls(opts: PostCtrlsOpts) { } const onPressToggleUpvoteWrapper = () => { if (!opts.isUpvoted) { + ReactNativeHapticFeedback.trigger('impactMedium') Animated.sequence([ Animated.timing(interp2, { toValue: 1, -- cgit 1.4.1