Add haptic feedback to likes and reposts
This commit is contained in:
parent
4966b2152e
commit
9f27af6199
4 changed files with 23 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue