Page MenuHomePhabricator

[native] Drawer labels styling
ClosedPublic

Authored by inka on Dec 14 2022, 8:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 6:28 AM
Unknown Object (File)
Tue, Nov 12, 1:21 AM
Unknown Object (File)
Tue, Nov 5, 7:25 AM
Unknown Object (File)
Tue, Nov 5, 7:25 AM
Unknown Object (File)
Tue, Nov 5, 7:25 AM
Unknown Object (File)
Tue, Nov 5, 7:25 AM
Unknown Object (File)
Mon, Oct 28, 8:29 AM
Unknown Object (File)
Oct 19 2024, 10:30 PM
Subscribers

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/navigation/community-drawer-content.react.js
61–68 ↗(On Diff #19344)

useStyles returns $ObjMap<S, ReplaceField> type. On this type the usual Array.from() / .values() don't work. I didn't find a better way of doing this. And I want to have an array of styles to use it in my function (createRecursiveDrawerItemsData) that recursively calculates the data for drawer items, so that I could find the right style based on the recursion depth (since styles are dependent on depth of a thread in the threads tree, ie communities are on depth 0, their children on depth 1 etc. and all communities are styled the same with style level0Label, all their children are styled the same with style level1Label etc. ).

inka requested review of this revision.Dec 14 2022, 8:40 AM
bartek added inline comments.
native/navigation/community-drawer-content.react.js
61–68 ↗(On Diff #19344)

Generally I'm not opposed to this solution, in fact, it's pretty clean. But I'd add a comment that this array should be of length MAX_DEPTH + 1, to make further maintenance more obvious.

This revision is now accepted and ready to land.Dec 20 2022, 3:00 AM
This revision now requires review to proceed.Dec 20 2022, 3:32 AM

Could you share some screenshots?

native/navigation/community-drawer-content.react.js
61–68 ↗(On Diff #19344)

I don't think it is a good decision to have different styles on each level. Regardless, we can assume now that every deeper level will have the same style as the last one - the code would be safer that way.

110 ↗(On Diff #19344)

We can make it safer

This revision is now accepted and ready to land.Dec 21 2022, 6:09 AM
This revision was automatically updated to reflect the committed changes.