Skip to content

Commit 4696ac6

Browse files
committed
fix: blurhash size
expo/expo#22206
1 parent 8e0915a commit 4696ac6

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

apps/mobile/src/modules/entry-list/entry-list-gird.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs"
44
import { useHeaderHeight } from "@react-navigation/elements"
55
import type { MasonryFlashListProps } from "@shopify/flash-list"
66
import { MasonryFlashList } from "@shopify/flash-list"
7+
import { Image } from "expo-image"
78
import { Link } from "expo-router"
89
import { useContext } from "react"
910
import { Pressable, View } from "react-native"
1011
import { useSafeAreaInsets } from "react-native-safe-area-context"
1112

12-
import { ReAnimatedExpoImage } from "@/src/components/common/AnimatedComponents"
1313
import { NavigationContext } from "@/src/components/common/SafeNavigationScrollView"
1414
import { ThemedText } from "@/src/components/common/ThemedText"
1515
import { ItemPressable } from "@/src/components/ui/pressable/item-pressable"
@@ -64,6 +64,7 @@ function RenderEntryItem({ id }: { id: string }) {
6464
const photo = item.media?.find((media) => media.type === "photo")
6565
const video = item.media?.find((media) => media.type === "video")
6666
const imageUrl = photo?.url || video?.preview_image_url
67+
const blurhash = photo?.blurhash || video?.blurhash
6768
const aspectRatio =
6869
view === FeedViewType.Pictures && photo?.height && photo.width
6970
? photo.width / photo.height
@@ -74,14 +75,16 @@ function RenderEntryItem({ id }: { id: string }) {
7475
<Link href={`/entries/${item.id}`} asChild>
7576
<Pressable>
7677
{imageUrl ? (
77-
<ReAnimatedExpoImage
78+
<Image
7879
source={{ uri: imageUrl }}
80+
placeholder={{
81+
blurhash,
82+
}}
7983
style={{
8084
width: "100%",
8185
aspectRatio,
8286
}}
83-
sharedTransitionTag={`entry-image-${imageUrl}`}
84-
allowDownscaling={false}
87+
placeholderContentFit="cover"
8588
recyclingKey={imageUrl}
8689
/>
8790
) : (

apps/mobile/src/screens/(stack)/entries/[entryId]/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ function Media({ media }: { media: MediaModel }) {
4747
display: isVideo ? (status?.isLoaded ? "none" : "flex") : "flex",
4848
}}
4949
contentFit="contain"
50+
placeholderContentFit="contain"
5051
/>
5152
) : (
5253
<Text className="text-gray-4 text-center">No media</Text>

0 commit comments

Comments
 (0)