about summary refs log tree commit diff
path: root/src/view/com/util/post-ctrls
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/com/util/post-ctrls')
-rw-r--r--src/view/com/util/post-ctrls/PostCtrls.tsx23
-rw-r--r--src/view/com/util/post-ctrls/RepostButton.tsx6
2 files changed, 7 insertions, 22 deletions
diff --git a/src/view/com/util/post-ctrls/PostCtrls.tsx b/src/view/com/util/post-ctrls/PostCtrls.tsx
index 5c0296e28..12d4c48c8 100644
--- a/src/view/com/util/post-ctrls/PostCtrls.tsx
+++ b/src/view/com/util/post-ctrls/PostCtrls.tsx
@@ -10,9 +10,6 @@ import {
   FontAwesomeIcon,
   FontAwesomeIconStyle,
 } from '@fortawesome/react-native-fontawesome'
-import ReactNativeHapticFeedback, {
-  HapticFeedbackTypes,
-} from 'react-native-haptic-feedback'
 // DISABLED see #135
 // import {
 //   TriggerableAnimated,
@@ -24,8 +21,8 @@ import {HeartIcon, HeartIconSolid, CommentBottomArrow} from 'lib/icons'
 import {s, colors} from 'lib/styles'
 import {useTheme} from 'lib/ThemeContext'
 import {useStores} from 'state/index'
-import {isIOS, isNative} from 'platform/detection'
 import {RepostButton} from './RepostButton'
+import {Haptics} from 'lib/haptics'
 
 interface PostCtrlsOpts {
   itemUri: string
@@ -58,7 +55,6 @@ interface PostCtrlsOpts {
 }
 
 const HITSLOP = {top: 5, left: 5, bottom: 5, right: 5}
-const hapticImpact: HapticFeedbackTypes = isIOS ? 'impactMedium' : 'impactLight' // Users said the medium impact was too strong on Android; see APP-537
 
 // DISABLED see #135
 /*
@@ -111,9 +107,7 @@ export function PostCtrls(opts: PostCtrlsOpts) {
   const onRepost = useCallback(() => {
     store.shell.closeModal()
     if (!opts.isReposted) {
-      if (isNative) {
-        ReactNativeHapticFeedback.trigger(hapticImpact)
-      }
+      Haptics.default()
       opts.onPressToggleRepost().catch(_e => undefined)
       // DISABLED see #135
       // repostRef.current?.trigger(
@@ -139,10 +133,7 @@ export function PostCtrls(opts: PostCtrlsOpts) {
         indexedAt: opts.indexedAt,
       },
     })
-
-    if (isNative) {
-      ReactNativeHapticFeedback.trigger(hapticImpact)
-    }
+    Haptics.default()
   }, [
     opts.author,
     opts.indexedAt,
@@ -154,7 +145,7 @@ export function PostCtrls(opts: PostCtrlsOpts) {
 
   const onPressToggleLikeWrapper = async () => {
     if (!opts.isLiked) {
-      ReactNativeHapticFeedback.trigger(hapticImpact)
+      Haptics.default()
       await opts.onPressToggleLike().catch(_e => undefined)
       // DISABLED see #135
       // likeRef.current?.trigger(
@@ -200,12 +191,10 @@ export function PostCtrls(opts: PostCtrlsOpts) {
         onPress={onPressToggleLikeWrapper}
         accessibilityRole="button"
         accessibilityLabel={opts.isLiked ? 'Unlike' : 'Like'}
-        accessibilityHint={
-          opts.isReposted ? `Removes like from the post` : `Like the post`
-        }>
+        accessibilityHint="">
         {opts.isLiked ? (
           <HeartIconSolid
-            style={styles.ctrlIconLiked as StyleProp<ViewStyle>}
+            style={styles.ctrlIconLiked}
             size={opts.big ? 22 : 16}
           />
         ) : (
diff --git a/src/view/com/util/post-ctrls/RepostButton.tsx b/src/view/com/util/post-ctrls/RepostButton.tsx
index e6de4cb19..59f7f6ee1 100644
--- a/src/view/com/util/post-ctrls/RepostButton.tsx
+++ b/src/view/com/util/post-ctrls/RepostButton.tsx
@@ -50,11 +50,7 @@ export const RepostButton = ({
       style={styles.control}
       accessibilityRole="button"
       accessibilityLabel={isReposted ? 'Undo repost' : 'Repost'}
-      accessibilityHint={
-        isReposted
-          ? `Remove your repost of the post`
-          : `Repost or quote post the post`
-      }>
+      accessibilityHint="">
       <RepostIcon
         style={
           isReposted