Skip to content

Avatar animate mode not supported on web #3554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2025

Conversation

adids1221
Copy link
Contributor

@adids1221 adids1221 commented Mar 5, 2025

Description

AnimatedImage doesn't work on web platform.
When using animated Avatar we render AnimatedImage which doesn't work, for now when using web we will set animate to false to prevent Avatar not to render as expected.
snippet:

<Avatar source={src} animate /> 

Changelog

Avatar with animated not supported on web.

Additional info

MADS-4577

Copy link
Collaborator

@ethanshar ethanshar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but see my comment

@@ -287,7 +288,7 @@ const Avatar = forwardRef<any, AvatarProps>((props: AvatarProps, ref: React.Forw
const renderImage = () => {
if (source !== undefined) {
// Looks like reanimated does not support SVG
const ImageContainer = animate && !isSvg(source) ? AnimatedImage : Image;
const ImageContainer = animate && !isSvg(source) && !Constants.isWeb ? AnimatedImage : Image;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also update in api.json about this prop that it's not supported on Web

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, missed that.

@adids1221 adids1221 enabled auto-merge (squash) March 6, 2025 07:46
@adids1221 adids1221 merged commit 90e75c9 into master Mar 6, 2025
1 check passed
@adids1221 adids1221 deleted the fix/Avatar_animated_not_supported_on_web branch March 6, 2025 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants