about summary refs log tree commit diff
path: root/src/view/com/util/images/AutoSizedImage.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-08-24 18:28:26 -0500
committerGitHub <noreply@github.com>2023-08-24 16:28:26 -0700
commit462022741d52c92ffe9d32e449bc7dbec3bd78a6 (patch)
treec2305c044daa5caf10a9723401aeff57c24b88bb /src/view/com/util/images/AutoSizedImage.tsx
parent4654a9a45e68eeba289f2f35473fb2af60e754e2 (diff)
downloadvoidsky-462022741d52c92ffe9d32e449bc7dbec3bd78a6.tar.zst
Use `Pressable` for most links/embeds (#1181)
* delay press on all links

* use Pressable for all accessible links
Diffstat (limited to 'src/view/com/util/images/AutoSizedImage.tsx')
-rw-r--r--src/view/com/util/images/AutoSizedImage.tsx14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/view/com/util/images/AutoSizedImage.tsx b/src/view/com/util/images/AutoSizedImage.tsx
index 9c6f25cae..da2f7ab45 100644
--- a/src/view/com/util/images/AutoSizedImage.tsx
+++ b/src/view/com/util/images/AutoSizedImage.tsx
@@ -1,17 +1,10 @@
 import React from 'react'
-import {
-  StyleProp,
-  StyleSheet,
-  TouchableOpacity,
-  View,
-  ViewStyle,
-} from 'react-native'
+import {StyleProp, StyleSheet, Pressable, View, ViewStyle} from 'react-native'
 import {Image} from 'expo-image'
 import {clamp} from 'lib/numbers'
 import {useStores} from 'state/index'
 import {Dimensions} from 'lib/media/types'
 
-export const DELAY_PRESS_IN = 500
 const MIN_ASPECT_RATIO = 0.33 // 1/3
 const MAX_ASPECT_RATIO = 5 // 5/1
 
@@ -57,11 +50,10 @@ export function AutoSizedImage({
 
   if (onPress || onLongPress || onPressIn) {
     return (
-      <TouchableOpacity
+      <Pressable
         onPress={onPress}
         onLongPress={onLongPress}
         onPressIn={onPressIn}
-        delayPressIn={DELAY_PRESS_IN}
         style={[styles.container, style]}
         accessible={true}
         accessibilityRole="button"
@@ -74,7 +66,7 @@ export function AutoSizedImage({
           accessibilityIgnoresInvertColors
         />
         {children}
-      </TouchableOpacity>
+      </Pressable>
     )
   }