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

Try out connect

This commit is contained in:
xmflsct
2023-01-29 15:32:40 +01:00
parent 3451a021e9
commit 95a99ef7cd
12 changed files with 233 additions and 32 deletions

View File

@ -1,4 +1,5 @@
import { useAccessibility } from '@utils/accessibility/AccessibilityManager'
import { connectImage } from '@utils/api/helpers/connect'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useEffect, useState } from 'react'
import {
@ -56,7 +57,7 @@ const GracefullyImage = ({
const [imageLoaded, setImageLoaded] = useState(false)
const [currentUri, setCurrentUri] = useState<string | undefined>(uri.original || uri.remote)
const source = {
const source: { uri?: string } = {
uri: reduceMotionEnabled && uri.static ? uri.static : currentUri
}
useEffect(() => {
@ -90,12 +91,12 @@ const GracefullyImage = ({
>
{uri.preview && !imageLoaded ? (
<FastImage
source={{ uri: uri.preview }}
source={connectImage({ uri: uri.preview })}
style={[styles.placeholder, { backgroundColor: colors.shimmerDefault }]}
/>
) : null}
<FastImage
source={source}
source={connectImage(source)}
style={[{ flex: 1 }, imageStyle]}
onLoad={() => {
setImageLoaded(true)