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
Unknown Object (File)
Sun, Nov 10, 9:24 PM
Unknown Object (File)
Thu, Nov 7, 10:37 PM
Unknown Object (File)
Thu, Nov 7, 10:37 PM
Unknown Object (File)
Thu, Nov 7, 10:37 PM
Unknown Object (File)
Thu, Nov 7, 10:37 PM
Unknown Object (File)
Thu, Nov 7, 10:37 PM
Unknown Object (File)
Thu, Nov 7, 10:37 PM
Unknown Object (File)
Thu, Nov 7, 10:30 PM
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
No Lint Coverage
Unit
No Test Coverage

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

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'