From 5caec6275d11046d7d0003d275ebfea921af014c Mon Sep 17 00:00:00 2001 From: Piyush Bhatt <2023kuec2027@iiitkota.ac.in> Date: Wed, 11 Dec 2024 01:38:04 +0530 Subject: [PATCH 1/2] avatar disabled --- .../components/avatar/UserAvatarEditor/UserAvatarEditor.tsx | 5 +++-- .../client/views/account/profile/AccountProfileForm.tsx | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarEditor.tsx b/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarEditor.tsx index 95659d762d30..0ecd5fda43ab 100644 --- a/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarEditor.tsx +++ b/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarEditor.tsx @@ -19,9 +19,10 @@ type UserAvatarEditorProps = { setAvatarObj: (obj: AvatarObject) => void; disabled?: boolean; etag: IUser['avatarETag']; + profileAvatar?: AvatarObject; }; -function UserAvatarEditor({ currentUsername, username, setAvatarObj, disabled, etag }: UserAvatarEditorProps): ReactElement { +function UserAvatarEditor({ currentUsername, username, setAvatarObj, disabled, etag, profileAvatar }: UserAvatarEditorProps): ReactElement { const { t } = useTranslation(); const rotateImages = useSetting('FileUpload_RotateImages'); const [avatarFromUrl, setAvatarFromUrl] = useState(''); @@ -90,7 +91,7 @@ function UserAvatarEditor({ currentUsername, username, setAvatarObj, disabled, e /> - diff --git a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx index 54875f0686cb..1568616f77d0 100644 --- a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx +++ b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx @@ -146,13 +146,14 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle ( + render={({ field: { onChange, value } }) => ( )} /> From d2bd80e1624f6930cc05f9bb923f60976ba54343 Mon Sep 17 00:00:00 2001 From: dougfabris Date: Thu, 12 Dec 2024 17:38:18 -0300 Subject: [PATCH 2/2] fix: review --- .../avatar/UserAvatarEditor/UserAvatarEditor.tsx | 12 +++++++++--- .../views/account/profile/AccountProfileForm.tsx | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarEditor.tsx b/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarEditor.tsx index 0ecd5fda43ab..c0a08cf89a9b 100644 --- a/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarEditor.tsx +++ b/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarEditor.tsx @@ -19,10 +19,10 @@ type UserAvatarEditorProps = { setAvatarObj: (obj: AvatarObject) => void; disabled?: boolean; etag: IUser['avatarETag']; - profileAvatar?: AvatarObject; + avatarValue?: AvatarObject; }; -function UserAvatarEditor({ currentUsername, username, setAvatarObj, disabled, etag, profileAvatar }: UserAvatarEditorProps): ReactElement { +function UserAvatarEditor({ currentUsername, username, setAvatarObj, disabled, etag, avatarValue }: UserAvatarEditorProps): ReactElement { const { t } = useTranslation(); const rotateImages = useSetting('FileUpload_RotateImages'); const [avatarFromUrl, setAvatarFromUrl] = useState(''); @@ -91,7 +91,13 @@ function UserAvatarEditor({ currentUsername, username, setAvatarObj, disabled, e /> - diff --git a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx index 1568616f77d0..5893561f58c5 100644 --- a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx +++ b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx @@ -153,7 +153,7 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle username={username} setAvatarObj={onChange} disabled={!allowUserAvatarChange} - profileAvatar={value} + avatarValue={value} /> )} />