From 2c64d28bddfe63233d782b763bf6ffecb902ccfe Mon Sep 17 00:00:00 2001
From: Stephen Zhou <38493346+hyoban@users.noreply.github.com>
Date: Thu, 13 Mar 2025 11:34:53 +0800
Subject: [PATCH] fix(mobile): no preview for avatar at header action (#3066)
* fix(mobile): no preview for avatar at header action
* update
---
.../src/components/ui/avatar/UserAvatar.tsx | 38 ++++++++++++-------
apps/mobile/src/modules/screen/action.tsx | 1 +
2 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/apps/mobile/src/components/ui/avatar/UserAvatar.tsx b/apps/mobile/src/components/ui/avatar/UserAvatar.tsx
index 42ca6d5a7..93f0b37d7 100644
--- a/apps/mobile/src/components/ui/avatar/UserAvatar.tsx
+++ b/apps/mobile/src/components/ui/avatar/UserAvatar.tsx
@@ -12,9 +12,17 @@ interface UserAvatarProps {
name?: string | null
className?: string
color?: string
+ noPreview?: boolean
}
-export const UserAvatar = ({ image, size = 24, name, className, color }: UserAvatarProps) => {
+export const UserAvatar = ({
+ image,
+ size = 24,
+ name,
+ className,
+ color,
+ noPreview,
+}: UserAvatarProps) => {
if (!image) {
return (
+ )
+
+ return noPreview ? (
+ imageContent
+ ) : (
-
-
-
+ {imageContent}
)
}
diff --git a/apps/mobile/src/modules/screen/action.tsx b/apps/mobile/src/modules/screen/action.tsx
index 1adf9eee8..943cdf8df 100644
--- a/apps/mobile/src/modules/screen/action.tsx
+++ b/apps/mobile/src/modules/screen/action.tsx
@@ -42,6 +42,7 @@ export function HomeLeftAction() {
name={user?.name}
className="rounded-full"
color={accentColor}
+ noPreview
/>