Skip to content

Commit

Permalink
Add hosted URL preview
Browse files Browse the repository at this point in the history
  • Loading branch information
brionmario committed Sep 6, 2020
1 parent 55c7676 commit a127afa
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export const EditAvatarModal: FunctionComponent<EditAvatarModalPropsInterface> =

if (avatarType !== AvatarTypes.URL) {
setCustomHostedURLError(null);

return;
}

Expand All @@ -386,7 +386,7 @@ export const EditAvatarModal: FunctionComponent<EditAvatarModalPropsInterface> =
content: translations.hostedAvatar.input.errors.invalid.content,
pointing: translations.hostedAvatar.input.errors.invalid.pointing as LabelProps["pointing"]
});

return;
}
};
Expand Down Expand Up @@ -571,13 +571,24 @@ export const EditAvatarModal: FunctionComponent<EditAvatarModalPropsInterface> =
<div className="avatar-from-url-field">
<Form.Field
fluid
className="hosted-url-input"
control={ Input }
placeholder={ translations.hostedAvatar.input.placeholder }
onFocus={ handleHostedURLFieldOnFocus }
onChange={ handleCustomHostedURLFieldOnChange }
error={ customHostedURLError }
loading={ isHostedURLValidationRequestLoading }
/>
{
customHostedURL && isHostedURLValid && (
<UserAvatar
spaced="left"
size="mini"
isLoading={ isHostedURLValidationRequestLoading }
image={ customHostedURL }
/>
)
}
</div>
<Hint>{ translations.hostedAvatar.input.hint }</Hint>
</Grid.Column>
Expand Down

0 comments on commit a127afa

Please sign in to comment.