Page MenuHomePhabricator

[native] Navigate from the community action sheet to the new community roles screen
ClosedPublic

Authored by rohan on Jun 28 2023, 9:42 AM.
Tags
None
Referenced Files
F2063010: D8358.id28272.diff
Fri, Jun 21, 3:42 AM
F2061752: D8358.id28218.diff
Fri, Jun 21, 12:36 AM
Unknown Object (File)
Thu, Jun 20, 1:06 PM
Unknown Object (File)
Wed, Jun 19, 8:45 AM
Unknown Object (File)
Wed, Jun 19, 5:33 AM
Unknown Object (File)
Wed, Jun 12, 9:56 PM
Unknown Object (File)
Wed, Jun 12, 4:06 AM
Unknown Object (File)
Tue, Jun 11, 11:19 AM
Subscribers

Details

Summary

Now that the role navigator is created, we can add the community roles screen and navigate to it when the 'Roles' option is selected on the action sheet. CommunityRolesScreen will be implemented later in the stack, this just handles the navigation aspect to make review easier and simpler overall. This screen will display all of the existing roles and member counts within a community, and an option to create a new role with selected permissions.

I created a new headerLeft since I couldn't re-use it from the change-roles flow as that had some role-changing specific logic built into it.

Depends on D8335

ENG-4169

Test Plan

Confirmed that the navigation works and it takes me to the newly created screen.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul requested changes to this revision.Jun 28 2023, 10:39 AM

Let's update CommunityRolesHeaderLeftButton to move the styles outside of the component to unboundStyles and then consume them within the component via the useStyles(...) hook.

Looks good other than that!

native/roles/community-roles-header-left-button.react.js
18–25 ↗(On Diff #28212)

We occasionaly need to define styles like this if some values are variable and depend on props/state/whatever.

However, in this case all of the styles are static so this can be defined outside of the component like:

const unboundStyles = {
  labelStyle: {
    color: 'panelForegroundLabel',
    fontSize: 16,
    marginLeft: 10,
  },
};

We can then consume the styles from within the component using the useStyles(...) hook:

const styles = useStyles(unboundStyles);

which will handle eg translating panelForegroundLabel to a color based on light/dark mode.

This revision now requires changes to proceed.Jun 28 2023, 10:39 AM

Sweet, thanks for addressing feedback

This revision is now accepted and ready to land.Jun 28 2023, 11:49 AM

headerTitle: 'Create Role' --> headerTitle: 'Create role'