Page MenuHomePhabricator

[web] add style prop to icon component
ClosedPublic

Authored by benschac on Mar 4 2022, 11:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 15, 8:59 AM
Unknown Object (File)
Fri, Nov 15, 8:59 AM
Unknown Object (File)
Fri, Nov 15, 8:59 AM
Unknown Object (File)
Sun, Nov 10, 7:32 AM
Unknown Object (File)
Sat, Nov 2, 8:20 AM
Unknown Object (File)
Sat, Nov 2, 8:20 AM
Unknown Object (File)
Sat, Nov 2, 8:20 AM
Unknown Object (File)
Sat, Nov 2, 8:19 AM

Details

Summary

we need a style prop to override inline styles the component gives us as defaults. This is a part of the API, I just never added it to the prop types initially.

style prop in icomoon component: https://github.com/aykutkardas/react-icomoon/blob/master/src/index.tsx#L71

Test Plan

We shouldn't have any type errors using the style prop, and the styles in the style prop should work as expected.

Diff Detail

Repository
rCOMM Comm
Branch
update-icon-component
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

This looks right to me... adding @ashoat as blocking reviewer since flow/I don't have much experience with the $Shape utility

This revision is now accepted and ready to land.Mar 4 2022, 12:38 PM
This revision now requires review to proceed.Mar 6 2022, 8:48 AM

This is a cool find – I've never actually encountered CSSStyleDeclaration before.

It took me some time to figure out if $Shape is necessary here. I saw CSSStyleDeclaration show up in the Flow lib, but I couldn't find any usage of $Shape<CSSStyleDeclaration>. I played around with it myself to confirm that $Shape was necessary, but for next time this is the kind of case where the diff author has the opportunity to save both reviewers a lot of time if you preemptively explain things that might be confusing.

This revision is now accepted and ready to land.Mar 7 2022, 10:26 PM