From 1af9de79fc8f3b5882531bd8b1c66d7d88fe12ed Mon Sep 17 00:00:00 2001 From: shuai Date: Fri, 28 Oct 2022 20:02:59 +0800 Subject: [PATCH] fix: ptimization of avatar taking values --- ui/src/components/BaseUserCard/index.tsx | 16 ++++++++++++++-- .../Header/components/NavItems/index.tsx | 2 +- ui/src/components/UserCard/index.tsx | 9 ++++++++- ui/src/pages/Admin/Users/index.tsx | 1 + .../Users/Personal/components/UserInfo/index.tsx | 4 ++-- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ui/src/components/BaseUserCard/index.tsx b/ui/src/components/BaseUserCard/index.tsx index 81d5a397..fa524bda 100644 --- a/ui/src/components/BaseUserCard/index.tsx +++ b/ui/src/components/BaseUserCard/index.tsx @@ -9,6 +9,7 @@ interface Props { data: any; showAvatar?: boolean; avatarSize?: string; + avatarSearchStr?: string; className?: string; } @@ -17,20 +18,31 @@ const Index: FC = ({ showAvatar = true, avatarSize = '20px', className = 'fs-14', + avatarSearchStr = 's=48', }) => { return (
{data?.status !== 'deleted' ? ( {showAvatar && ( - + )} {data?.display_name} ) : ( <> {showAvatar && ( - + )} {data?.display_name} diff --git a/ui/src/components/Header/components/NavItems/index.tsx b/ui/src/components/Header/components/NavItems/index.tsx index ec2009ec..67112758 100644 --- a/ui/src/components/Header/components/NavItems/index.tsx +++ b/ui/src/components/Header/components/NavItems/index.tsx @@ -43,7 +43,7 @@ const Index: FC = ({ redDot, userInfo, logOut }) => { id="dropdown-basic" as="a" className="no-toggle pointer"> - + diff --git a/ui/src/components/UserCard/index.tsx b/ui/src/components/UserCard/index.tsx index 259ab8c5..0110c82a 100644 --- a/ui/src/components/UserCard/index.tsx +++ b/ui/src/components/UserCard/index.tsx @@ -23,16 +23,23 @@ const Index: FC = ({ data, time, preFix, className = '' }) => { avatar={data?.avatar} size="40px" className="me-2 d-none d-md-block" + searchStr="s=48" /> ) : ( - + )}
diff --git a/ui/src/pages/Admin/Users/index.tsx b/ui/src/pages/Admin/Users/index.tsx index 6662b11f..f15db7b5 100644 --- a/ui/src/pages/Admin/Users/index.tsx +++ b/ui/src/pages/Admin/Users/index.tsx @@ -107,6 +107,7 @@ const Users: FC = () => { data={user} className="fs-6" avatarSize="24px" + avatarSearchStr="s=48" /> {user.rank} diff --git a/ui/src/pages/Users/Personal/components/UserInfo/index.tsx b/ui/src/pages/Users/Personal/components/UserInfo/index.tsx index 02b39b68..97caca3e 100644 --- a/ui/src/pages/Users/Personal/components/UserInfo/index.tsx +++ b/ui/src/pages/Users/Personal/components/UserInfo/index.tsx @@ -19,10 +19,10 @@ const Index: FC = ({ data }) => {
{data?.status !== 'deleted' ? ( - + ) : ( - + )}