mirror of https://github.com/tooot-app/app
commit
492b77b1bb
|
@ -4,7 +4,7 @@
|
||||||
"native": "210511",
|
"native": "210511",
|
||||||
"major": 2,
|
"major": 2,
|
||||||
"minor": 1,
|
"minor": 1,
|
||||||
"patch": 2,
|
"patch": 3,
|
||||||
"expo": "41.0.0"
|
"expo": "41.0.0"
|
||||||
},
|
},
|
||||||
"description": "tooot app for Mastodon",
|
"description": "tooot app for Mastodon",
|
||||||
|
|
|
@ -9,6 +9,7 @@ import { useNavigation } from '@react-navigation/native'
|
||||||
import { StyleConstants } from '@utils/styles/constants'
|
import { StyleConstants } from '@utils/styles/constants'
|
||||||
import layoutAnimation from '@utils/styles/layoutAnimation'
|
import layoutAnimation from '@utils/styles/layoutAnimation'
|
||||||
import React, { useCallback, useMemo, useRef, useState } from 'react'
|
import React, { useCallback, useMemo, useRef, useState } from 'react'
|
||||||
|
import { useEffect } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { Pressable, StyleSheet, View } from 'react-native'
|
import { Pressable, StyleSheet, View } from 'react-native'
|
||||||
|
|
||||||
|
@ -37,14 +38,8 @@ const TimelineAttachment = React.memo(
|
||||||
Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls']
|
Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls']
|
||||||
>([])
|
>([])
|
||||||
const navigation = useNavigation()
|
const navigation = useNavigation()
|
||||||
const navigateToImagesViewer = (id: string) =>
|
useEffect(() => {
|
||||||
navigation.navigate('Screen-ImagesViewer', {
|
status.media_attachments.forEach((attachment, index) => {
|
||||||
imageUrls: imageUrls.current,
|
|
||||||
id
|
|
||||||
})
|
|
||||||
const attachments = useMemo(
|
|
||||||
() =>
|
|
||||||
status.media_attachments.map((attachment, index) => {
|
|
||||||
switch (attachment.type) {
|
switch (attachment.type) {
|
||||||
case 'image':
|
case 'image':
|
||||||
imageUrls.current.push({
|
imageUrls.current.push({
|
||||||
|
@ -56,6 +51,19 @@ const TimelineAttachment = React.memo(
|
||||||
width: attachment.meta?.original?.width,
|
width: attachment.meta?.original?.width,
|
||||||
height: attachment.meta?.original?.height
|
height: attachment.meta?.original?.height
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, [])
|
||||||
|
const navigateToImagesViewer = (id: string) =>
|
||||||
|
navigation.navigate('Screen-ImagesViewer', {
|
||||||
|
imageUrls: imageUrls.current,
|
||||||
|
id
|
||||||
|
})
|
||||||
|
const attachments = useMemo(
|
||||||
|
() =>
|
||||||
|
status.media_attachments.map((attachment, index) => {
|
||||||
|
switch (attachment.type) {
|
||||||
|
case 'image':
|
||||||
return (
|
return (
|
||||||
<AttachmentImage
|
<AttachmentImage
|
||||||
key={index}
|
key={index}
|
||||||
|
|
Loading…
Reference in New Issue