allow image to clicked to go to post in notificaitons (#858)
parent
bdcdb4e4dc
commit
fc12a1205c
|
@ -165,7 +165,7 @@ export const FeedItem = observer(function ({
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line react-native-a11y/no-nested-touchables
|
||||||
<Link
|
<Link
|
||||||
testID={`feedItem-by-${item.author.handle}`}
|
testID={`feedItem-by-${item.author.handle}`}
|
||||||
style={[
|
style={[
|
||||||
|
|
|
@ -1,41 +1,17 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {
|
import {StyleProp, StyleSheet, View, ViewStyle} from 'react-native'
|
||||||
StyleProp,
|
|
||||||
StyleSheet,
|
|
||||||
TouchableWithoutFeedback,
|
|
||||||
View,
|
|
||||||
ViewStyle,
|
|
||||||
} from 'react-native'
|
|
||||||
import {Image} from 'expo-image'
|
import {Image} from 'expo-image'
|
||||||
import {AppBskyEmbedImages} from '@atproto/api'
|
import {AppBskyEmbedImages} from '@atproto/api'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
images: AppBskyEmbedImages.ViewImage[]
|
images: AppBskyEmbedImages.ViewImage[]
|
||||||
onPress?: (index: number) => void
|
|
||||||
style?: StyleProp<ViewStyle>
|
style?: StyleProp<ViewStyle>
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ImageHorzList({images, onPress, style}: Props) {
|
export function ImageHorzList({images, style}: Props) {
|
||||||
const numImages = images.length
|
|
||||||
return (
|
return (
|
||||||
<View style={[styles.flexRow, style]}>
|
<View style={[styles.flexRow, style]}>
|
||||||
{images.map(({thumb, alt}, i) => (
|
{images.map(({thumb, alt}) => (
|
||||||
<TouchableWithoutFeedback
|
|
||||||
key={i}
|
|
||||||
onPress={() => onPress?.(i)}
|
|
||||||
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
|
<Image
|
||||||
source={{uri: thumb}}
|
source={{uri: thumb}}
|
||||||
style={styles.image}
|
style={styles.image}
|
||||||
|
@ -44,7 +20,6 @@ export function ImageHorzList({images, onPress, style}: Props) {
|
||||||
accessibilityHint={alt}
|
accessibilityHint={alt}
|
||||||
accessibilityLabel=""
|
accessibilityLabel=""
|
||||||
/>
|
/>
|
||||||
</TouchableWithoutFeedback>
|
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue