Page MenuHomePhabricator

[native] Drawer labels styling
ClosedPublic

Authored by inka on Dec 14 2022, 8:28 AM.
Tags
None
Referenced Files
F3356414: D5867.id20313.diff
Sat, Nov 23, 6:48 PM
F3356142: D5867.diff
Sat, Nov 23, 5:05 PM
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
Subscribers

Diff Detail

Repository
rCOMM Comm
Branch
inka/community_drawer
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/navigation/community-drawer-content.react.js
61–68

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

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

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

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.