Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris committed Dec 12, 2024
1 parent 5caec62 commit d2bd80e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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('');
Expand Down Expand Up @@ -91,7 +91,13 @@ function UserAvatarEditor({ currentUsername, username, setAvatarObj, disabled, e
/>
<Box display='flex' flexDirection='column' flexGrow='1' justifyContent='space-between' mis={4}>
<Box display='flex' flexDirection='row' mbs='none'>
<Button square disabled={!profileAvatar || disabled} mi={4} title={t('Accounts_SetDefaultAvatar')} onClick={clickReset}>
<Button
square
disabled={avatarValue === 'reset' || disabled}
mi={4}
title={t('Accounts_SetDefaultAvatar')}
onClick={clickReset}
>
<Avatar url={`/avatar/%40${username}`} />
</Button>
<IconButton icon='upload' secondary disabled={disabled} title={t('Upload')} mi={4} onClick={clickUpload} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const AccountProfileForm = (props: AllHTMLAttributes<HTMLFormElement>): ReactEle
username={username}
setAvatarObj={onChange}
disabled={!allowUserAvatarChange}
profileAvatar={value}
avatarValue={value}
/>
)}
/>
Expand Down

0 comments on commit d2bd80e

Please sign in to comment.