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

Start using react-native-expo-image-cache

This commit is contained in:
Zhiyuan Zheng
2020-12-24 11:12:40 +01:00
parent 97442b31db
commit dca138eb5c
6 changed files with 50 additions and 7 deletions

View File

@ -45,14 +45,14 @@ const Core: React.FC<Props> = ({
</View>
{(content || iconBack) && (
<View style={styles.back}>
{content && (
{content && content.length ? (
<Text
style={[styles.content, { color: theme.secondary }]}
numberOfLines={1}
>
{content}
</Text>
)}
) : null}
{iconBack && (
<Feather
name={iconBack}

View File

@ -1,7 +1,9 @@
import React, { useCallback } from 'react'
import { Image, Pressable, StyleSheet } from 'react-native'
import { Pressable, StyleSheet } from 'react-native'
import { Image } from 'react-native-expo-image-cache'
import { StyleConstants } from '@utils/styles/constants'
import { useNavigation } from '@react-navigation/native'
import { useTheme } from '@root/utils/styles/ThemeManager'
export interface Props {
queryKey?: QueryKey.Timeline
@ -9,6 +11,7 @@ export interface Props {
}
const TimelineAvatar: React.FC<Props> = ({ queryKey, account }) => {
const { mode } = useTheme()
const navigation = useNavigation()
// Need to fix go back root
const onPress = useCallback(() => {
@ -17,7 +20,7 @@ const TimelineAvatar: React.FC<Props> = ({ queryKey, account }) => {
return (
<Pressable style={styles.avatar} onPress={onPress}>
<Image source={{ uri: account.avatar_static }} style={styles.image} />
<Image uri={account.avatar_static} style={styles.image} />
</Pressable>
)
}