Page MenuHomePhabricator

[native] Refactor MediaGalleryMedia to function component
ClosedPublic

Authored by inka on May 21 2024, 6:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 21, 5:28 AM
Unknown Object (File)
Fri, Jun 21, 5:28 AM
Unknown Object (File)
Fri, Jun 21, 5:28 AM
Unknown Object (File)
Fri, Jun 21, 5:28 AM
Unknown Object (File)
Fri, Jun 21, 5:28 AM
Unknown Object (File)
Fri, Jun 14, 5:04 AM
Unknown Object (File)
Thu, Jun 13, 7:13 AM
Unknown Object (File)
Sun, Jun 9, 8:21 PM
Subscribers

Details

Summary

I need this component to be a function to be able to use useAnimatedStyle when migrating to Reanimated 2

Test Plan

Teset that the gallery still works - its possible to send, queue, dequeue media. The animations seem to work as previously

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Not sure about memoizing buttons, media and overlay...

inka requested review of this revision.May 21 2024, 7:11 AM

Looks great!

native/media/media-gallery-media.react.js
57–65 ↗(On Diff #40462)

I think it would improve readability to use the same order that is defined in Props

232 ↗(On Diff #40462)

Now that we have a function component, it's easier to memoize things. Can we memoize [mediaStyle, dimensionsStyle], to avoid passing a new style to AnimatedImage on every render?

This revision is now accepted and ready to land.May 21 2024, 10:03 AM