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