Page MenuHomePhabricator

[native] Migrate opacity in MultimediaMessageMultimedia to Reanimated v2 API in functional component
ClosedPublic

Authored by angelika on Wed, Dec 11, 12:26 PM.
Tags
None
Referenced Files
F3491273: D14133.diff
Wed, Dec 18, 6:23 PM
Unknown Object (File)
Tue, Dec 17, 8:16 AM
Unknown Object (File)
Fri, Dec 13, 11:17 PM
Subscribers
None

Details

Summary

Originally opacity was held in a state because the component needed to be rerendered every time it changed from a number (if there is no overlay position) to a reanimated node (or the other way). And we used opacity only in animatedWrapperStyle. But in reanimated v2 we can assign a number or interpolated value in useAnimatedStyle so we don’t need a state anymore.
Because migrating the state to a functional component and then getting rid of it anyway when migrating to reanimated v2 api seems like unnecessary hassle, I migrated it in one diff

Depends on D14132

Test Plan

Open up a multimedia message and see if it behaves correctly.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

angelika held this revision as a draft.
ashoat added inline comments.
native/chat/multimedia-message-multimedia.react.js
189–203 ↗(On Diff #46352)

Nit: I would use an IIFE for this, to make it clear to the reader that the function is only invoked once, and immediately

This revision is now accepted and ready to land.Wed, Dec 11, 8:07 PM

Rebase and address feedback