diff options
author | Ansh <anshnanda10@gmail.com> | 2023-06-07 07:57:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-07 09:57:49 -0500 |
commit | fc12a1205cceab323f1165205cd68268ff291436 (patch) | |
tree | 85da9fba7f197d1de11aa2535417a26da07ae375 | |
parent | bdcdb4e4dc9636834b54147d666e6f6024fcff7b (diff) | |
download | voidsky-fc12a1205cceab323f1165205cd68268ff291436.tar.zst |
allow image to clicked to go to post in notificaitons (#858)
-rw-r--r-- | src/view/com/notifications/FeedItem.tsx | 2 | ||||
-rw-r--r-- | src/view/com/util/images/ImageHorzList.tsx | 45 |
2 files changed, 11 insertions, 36 deletions
diff --git a/src/view/com/notifications/FeedItem.tsx b/src/view/com/notifications/FeedItem.tsx index ac2e2a190..7994c53ab 100644 --- a/src/view/com/notifications/FeedItem.tsx +++ b/src/view/com/notifications/FeedItem.tsx @@ -165,7 +165,7 @@ export const FeedItem = observer(function ({ } return ( - // eslint-disable-next-line + // eslint-disable-next-line react-native-a11y/no-nested-touchables <Link testID={`feedItem-by-${item.author.handle}`} style={[ diff --git a/src/view/com/util/images/ImageHorzList.tsx b/src/view/com/util/images/ImageHorzList.tsx index 88494bba3..14a8dd7e7 100644 --- a/src/view/com/util/images/ImageHorzList.tsx +++ b/src/view/com/util/images/ImageHorzList.tsx @@ -1,50 +1,25 @@ import React from 'react' -import { - StyleProp, - StyleSheet, - TouchableWithoutFeedback, - View, - ViewStyle, -} from 'react-native' +import {StyleProp, StyleSheet, View, ViewStyle} from 'react-native' import {Image} from 'expo-image' import {AppBskyEmbedImages} from '@atproto/api' interface Props { images: AppBskyEmbedImages.ViewImage[] - onPress?: (index: number) => void style?: StyleProp<ViewStyle> } -export function ImageHorzList({images, onPress, style}: Props) { - const numImages = images.length +export function ImageHorzList({images, style}: Props) { return ( <View style={[styles.flexRow, style]}> - {images.map(({thumb, alt}, i) => ( - <TouchableWithoutFeedback - key={i} - onPress={() => onPress?.(i)} + {images.map(({thumb, alt}) => ( + <Image + source={{uri: thumb}} + style={styles.image} accessible={true} - accessibilityLabel={`Open image ${i} of ${numImages}`} - accessibilityHint="Opens image in viewer" - accessibilityActions={[{name: 'press', label: 'Press'}]} - onAccessibilityAction={action => { - switch (action.nativeEvent.actionName) { - case 'press': - onPress?.(0) - break - default: - break - } - }}> - <Image - source={{uri: thumb}} - style={styles.image} - accessible={true} - accessibilityIgnoresInvertColors - accessibilityHint={alt} - accessibilityLabel="" - /> - </TouchableWithoutFeedback> + accessibilityIgnoresInvertColors + accessibilityHint={alt} + accessibilityLabel="" + /> ))} </View> ) |