mirror of
https://github.com/tooot-app/app
synced 2025-01-30 10:14:53 +01:00
Try with RN Image instead of fast-image
This commit is contained in:
parent
f9f9b783e3
commit
5243f71c8c
@ -1,9 +1,15 @@
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import { useTheme } from '@utils/styles/ThemeManager'
|
||||
import React, { useCallback, useMemo, useRef, useState } from 'react'
|
||||
import { Pressable, StyleProp, StyleSheet, ViewStyle } from 'react-native'
|
||||
import {
|
||||
Image,
|
||||
ImageStyle,
|
||||
Pressable,
|
||||
StyleProp,
|
||||
StyleSheet,
|
||||
ViewStyle
|
||||
} from 'react-native'
|
||||
import { Blurhash } from 'react-native-blurhash'
|
||||
import FastImage, { ImageStyle } from 'react-native-fast-image'
|
||||
|
||||
// blurhas -> if blurhash, show before any loading succeed
|
||||
// original -> load original
|
||||
@ -70,7 +76,7 @@ const GracefullyImage = React.memo(
|
||||
const previewView = useMemo(
|
||||
() =>
|
||||
uri.preview && !imageLoaded ? (
|
||||
<FastImage
|
||||
<Image
|
||||
source={{ uri: uri.preview }}
|
||||
style={[{ flex: 1 }, imageStyle]}
|
||||
/>
|
||||
@ -79,14 +85,14 @@ const GracefullyImage = React.memo(
|
||||
)
|
||||
const originalView = useMemo(
|
||||
() => (
|
||||
<FastImage
|
||||
<Image
|
||||
source={source}
|
||||
style={[{ flex: imageLoaded ? 1 : undefined }, imageStyle]}
|
||||
style={[{ flex: 1 }, imageStyle]}
|
||||
onLoad={onLoad}
|
||||
onError={onError}
|
||||
/>
|
||||
),
|
||||
[source, imageLoaded]
|
||||
[source]
|
||||
)
|
||||
const blurhashView = useMemo(() => {
|
||||
return blurhash && (hidden || !imageLoaded) ? (
|
||||
|
@ -86,9 +86,9 @@ const HeaderComponent = React.memo(
|
||||
analytics('imageviewer_more_share_press')
|
||||
switch (Platform.OS) {
|
||||
case 'ios':
|
||||
return Share.share({ url: imageUrls[currentIndex].url })
|
||||
Share.share({ url: imageUrls[currentIndex].url })
|
||||
case 'android':
|
||||
return Share.share({ message: imageUrls[currentIndex].url })
|
||||
Share.share({ message: imageUrls[currentIndex].url })
|
||||
}
|
||||
break
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user