diff options
| author | Mohamed Bassem <me@mbassem.com> | 2026-02-01 19:43:32 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2026-02-01 19:43:32 +0000 |
| commit | e86188000147e0178ac6ca971f061b37daa40132 (patch) | |
| tree | 654b20fd932d9ca4f93ef4e2bfc85ff6d9fd624c /apps/mobile/components/ui | |
| parent | b16fa5e21a3852151c6b3d3d5569154d863d1795 (diff) | |
| download | karakeep-e86188000147e0178ac6ca971f061b37daa40132.tar.zst | |
fix(mobile): migrate from RN image to expo-image
Diffstat (limited to 'apps/mobile/components/ui')
| -rw-r--r-- | apps/mobile/components/ui/Avatar.tsx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/apps/mobile/components/ui/Avatar.tsx b/apps/mobile/components/ui/Avatar.tsx index 923c634e..ed31df23 100644 --- a/apps/mobile/components/ui/Avatar.tsx +++ b/apps/mobile/components/ui/Avatar.tsx @@ -1,5 +1,6 @@ import * as React from "react"; -import { Image, View } from "react-native"; +import { View } from "react-native"; +import { Image } from "expo-image"; import { Text } from "@/components/ui/Text"; import { useAssetUrl } from "@/lib/hooks"; import { cn } from "@/lib/utils"; @@ -9,7 +10,6 @@ interface AvatarProps { name?: string | null; size?: number; className?: string; - imageClassName?: string; fallbackClassName?: string; } @@ -22,7 +22,6 @@ export function Avatar({ name, size = 40, className, - imageClassName, fallbackClassName, }: AvatarProps) { const [imageError, setImageError] = React.useState(false); @@ -78,8 +77,8 @@ export function Avatar({ ) : ( <Image source={imageUrl} - className={cn("h-full w-full", imageClassName)} - style={{ resizeMode: "cover" }} + style={{ width: "100%", height: "100%" }} + contentFit="cover" onError={() => setImageError(true)} /> )} |
