diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-12-14 15:46:21 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-12-14 15:46:21 -0600 |
commit | 9f27af619918549d1c1decd048d5832b938ff32a (patch) | |
tree | 0ea17a15c301071ad88901b4f13633dfc8ef3ec6 /src/view/com/util/PostCtrls.tsx | |
parent | 4966b2152eb213bac34cbcb0ff01c246b7746f5c (diff) | |
download | voidsky-9f27af619918549d1c1decd048d5832b938ff32a.tar.zst |
Add haptic feedback to likes and reposts
Diffstat (limited to 'src/view/com/util/PostCtrls.tsx')
-rw-r--r-- | src/view/com/util/PostCtrls.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
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, |