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)
Sun, Nov 10, 4:22 AM
Unknown Object (File)
Sat, Nov 9, 9:10 PM
Unknown Object (File)
Sat, Nov 9, 8:39 PM
Unknown Object (File)
Sat, Nov 9, 8:39 PM
Unknown Object (File)
Sat, Nov 9, 2:19 PM
Unknown Object (File)
Fri, Nov 8, 11:08 AM
Unknown Object (File)
Sep 26 2024, 1:44 AM
Unknown Object (File)
Sep 26 2024, 1:44 AM
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
Branch
inka/reanimated
Lint
No Lint Coverage
Unit
No Test Coverage

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