Page MenuHomePhabricator

[native] Refactor MediaGalleryMedia to function component
ClosedPublic

Authored by inka on May 21 2024, 6:51 AM.
Tags
None
Referenced Files
F3399642: D12144.id40495.diff
Mon, Dec 2, 4:10 AM
F3399536: D12144.id40462.diff
Mon, Dec 2, 3:36 AM
Unknown Object (File)
Mon, Dec 2, 3:12 AM
Unknown Object (File)
Fri, Nov 29, 9:43 PM
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
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