Remove all FastImage

This commit is contained in:
Zhiyuan Zheng 2021-03-19 21:44:52 +01:00
parent e620754c15
commit 15cf29d952
No known key found for this signature in database
GPG Key ID: 078A93AB607D85E0
8 changed files with 21 additions and 19 deletions

View File

@ -19,7 +19,7 @@ import { Blurhash } from 'react-native-blurhash'
export interface Props {
hidden?: boolean
uri: { preview?: string; original: string; remote?: string }
uri: { preview?: string; original?: string; remote?: string }
blurhash?: string
dimension?: { width: number; height: number }
onPress?: () => void

View File

@ -3,8 +3,7 @@ import { StyleConstants } from '@utils/styles/constants'
import { adaptiveScale } from '@utils/styles/scaling'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useMemo } from 'react'
import { StyleSheet, Text } from 'react-native'
import FastImage from 'react-native-fast-image'
import { Image, StyleSheet, Text } from 'react-native'
import { useSelector } from 'react-redux'
const regexEmoji = new RegExp(/(:[A-Za-z0-9_]+:)/)
@ -70,7 +69,7 @@ const ParseEmojis = React.memo(
<Text key={i}>
{/* When emoji starts a paragraph, lineHeight will break */}
{i === 0 ? <Text> </Text> : null}
<FastImage
<Image
key={adaptiveFontsize}
source={{ uri: emojis[emojiIndex].url }}
style={styles.image}

View File

@ -13,6 +13,7 @@ import React, { useCallback, useContext, useState } from 'react'
import { useTranslation } from 'react-i18next'
import {
Dimensions,
Image,
Modal,
Platform,
Pressable,
@ -20,7 +21,6 @@ import {
Text,
View
} from 'react-native'
import FastImage from 'react-native-fast-image'
import { PanGestureHandler } from 'react-native-gesture-handler'
import { SwipeListView } from 'react-native-swipe-list-view'
import { useDispatch, useSelector } from 'react-redux'
@ -112,7 +112,7 @@ const ComposeDraftsListRoot: React.FC<Props> = ({ timestamp }) => {
{item.attachments?.uploads.length ? (
<View style={styles.attachments}>
{item.attachments.uploads.map((attachment, index) => (
<FastImage
<Image
key={index}
style={[
styles.attachment,

View File

@ -2,8 +2,7 @@ import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useContext } from 'react'
import { useTranslation } from 'react-i18next'
import { Dimensions, StyleSheet, Text, View } from 'react-native'
import FastImage from 'react-native-fast-image'
import { Dimensions, Image, StyleSheet, Text, View } from 'react-native'
import { PanGestureHandler } from 'react-native-gesture-handler'
import Animated, {
Extrapolate,
@ -120,7 +119,7 @@ const ComposeEditAttachmentImage: React.FC<Props> = ({ index }) => {
return (
<>
<View style={styles.base}>
<FastImage
<Image
style={{
width: imageDimensionis.width,
height: imageDimensionis.height

View File

@ -15,9 +15,15 @@ import React, {
useRef
} from 'react'
import { useTranslation } from 'react-i18next'
import { FlatList, Pressable, StyleSheet, Text, View } from 'react-native'
import {
FlatList,
Image,
Pressable,
StyleSheet,
Text,
View
} from 'react-native'
import { Circle } from 'react-native-animated-spinkit'
import FastImage from 'react-native-fast-image'
import ComposeContext from '../../utils/createContext'
import { ExtendedAttachment } from '../../utils/types'
import addAttachment from './addAttachment'
@ -113,7 +119,7 @@ const ComposeAttachments: React.FC = () => {
key={index}
style={[styles.container, { width: calculateWidth(item) }]}
>
<FastImage
<Image
style={styles.image}
source={{
uri: item.local?.local_thumbnail || item.remote?.preview_url

View File

@ -13,8 +13,7 @@ import {
} from '@utils/slices/instancesSlice'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useCallback, useMemo } from 'react'
import { Platform } from 'react-native'
import FastImage from 'react-native-fast-image'
import { Image, Platform } from 'react-native'
import { useSelector } from 'react-redux'
import TabLocal from './Tabs/Local'
import TabMe from './Tabs/Me'
@ -69,7 +68,7 @@ const ScreenTabs = React.memo(
return <Icon name='Bell' size={size} color={color} />
case 'Tab-Me':
return instanceActive !== -1 ? (
<FastImage
<Image
source={{
uri: instanceAccount?.avatarStatic
}}

View File

@ -1,7 +1,6 @@
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useContext } from 'react'
import { Dimensions } from 'react-native'
import FastImage from 'react-native-fast-image'
import { Dimensions, Image } from 'react-native'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
import AccountContext from './utils/createContext'
@ -16,7 +15,7 @@ const AccountHeader: React.FC<Props> = ({ account, limitHeight = false }) => {
const topInset = useSafeAreaInsets().top
return (
<FastImage
<Image
source={{ uri: account?.header }}
style={{
height:

View File

@ -28,7 +28,7 @@ const AccountInformationAvatar: React.FC<Props> = ({ account, myInfo }) => {
<GracefullyImage
key={account?.avatar}
style={styles.image}
uri={{ original: account?.avatar || '' }}
uri={{ original: account?.avatar }}
/>
</Pressable>
)