Skip to content

Commit

Permalink
Merge pull request #379 from AnnMarieW/issue-374
Browse files Browse the repository at this point in the history
Enable base64 images in Avatar
  • Loading branch information
AnnMarieW authored Oct 31, 2024
2 parents 2410744 + 93eada5 commit 8c567d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

### Fixed
- Prevent loading from empty `src` in `Avatar`. #372 by @mmarfat
- Enable base64 images in Avatar #379 by @AnnMarieW

# 0.14.6

Expand Down
5 changes: 1 addition & 4 deletions src/ts/components/core/avatar/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { sanitizeUrl } from "@braintree/sanitize-url";
import {
Avatar as MantineAvatar,
MantineColor,
Expand Down Expand Up @@ -34,15 +33,13 @@ interface Props extends BoxProps, StylesApiProps, DashBaseProps {

/** Avatar */
const Avatar = (props: Props) => {
const { children, src, setProps, loading_state, ...others } = props;
const sanitizedSrc = useMemo(() => (src ? sanitizeUrl(src) : undefined), [src]);
const { children, setProps, loading_state, ...others } = props;

return (
<MantineAvatar
data-dash-is-loading={
(loading_state && loading_state.is_loading) || undefined
}
src={sanitizedSrc}
{...others}
>
{children}
Expand Down

0 comments on commit 8c567d7

Please sign in to comment.