Skip to content

Commit 88c183e

Browse files
committed
UI: 用户编辑页面样式优化
1 parent 2adea4a commit 88c183e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/pages/User/Edit/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,10 @@ const EditUser: React.FC = () => {
224224

225225
const avatarColorList = ['#f56a00', '#7265e6', '#ffbf00', '#00a2ae'];
226226

227-
const getAvatarColor = (name?: string) => {
227+
const getAvatarColor = (name?: string, avatar?: string) => {
228+
if (avatar) {
229+
return '';
230+
}
228231
if (!name) {
229232
return avatarColorList[0];
230233
}
@@ -234,9 +237,10 @@ const EditUser: React.FC = () => {
234237
const userAvatarTitle = (
235238
<div>
236239
<Avatar
240+
src={userInfo && userInfo.avatar ? userInfo.avatar : null}
237241
style={{
238-
backgroundColor: getAvatarColor(userInfo?.metadata.name),
239-
verticalAlign: 'middle',
242+
backgroundColor: getAvatarColor(userInfo?.metadata.name, userInfo?.avatar),
243+
verticalAlign: 'bottom',
240244
}}
241245
size={56}
242246
gap={4}

0 commit comments

Comments
 (0)