1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Update image viewer index seraching

This commit is contained in:
Zhiyuan Zheng
2021-03-06 23:42:29 +01:00
parent 4cf7b79f83
commit 960634ec0b
5 changed files with 13 additions and 15 deletions

View File

@ -35,10 +35,10 @@ const TimelineAttachment = React.memo(
let imageUrls: Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls'] = []
const navigation = useNavigation()
const navigateToImagesViewer = (imageIndex: number) =>
const navigateToImagesViewer = (id: string) =>
navigation.navigate('Screen-ImagesViewer', {
imageUrls,
imageIndex
id
})
const attachments = useMemo(
() =>
@ -46,12 +46,12 @@ const TimelineAttachment = React.memo(
switch (attachment.type) {
case 'image':
imageUrls.push({
id: attachment.id,
url: attachment.url,
preview_url: attachment.preview_url,
remote_url: attachment.remote_url,
width: attachment.meta?.original?.width,
height: attachment.meta?.original?.height,
imageIndex: index
height: attachment.meta?.original?.height
})
return (
<AttachmentImage