Skip to content

Commit

Permalink
[web] Update the change role icon on web
Browse files Browse the repository at this point in the history
Summary:
The icon for the change role action item in the members modal is currently a `plus-circle`. After some discussion, we need to use the new `edit-1` icon part of the `CommIcon` component.

`MenuItem` defaults to using a `SWMansionIcon` if a icon name is provided:
```
  let menuItemIcon = iconComponent;
  if (icon) {
    menuItemIcon = <SWMansionIcon size="100%" icon={icon} />;
  }
```

so instead I used the existing `iconComponent` prop to pass in the `CommIcon` we're using.

Test Plan:
The new icon looks as expected

{F632135}

Reviewers: atul, ginsu

Reviewed By: ginsu

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D8479
  • Loading branch information
RohanK6 committed Jul 14, 2023
1 parent 932c409 commit 78707c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/modals/threads/members/member.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ import {
import ChangeMemberRoleModal from './change-member-role-modal.react.js';
import css from './members-modal.css';
import UserAvatar from '../../../avatars/user-avatar.react.js';
import CommIcon from '../../../CommIcon.react.js';
import Label from '../../../components/label.react.js';
import MenuItem from '../../../components/menu-item.react.js';
import Menu from '../../../components/menu.react.js';

const commIconComponent = <CommIcon size={18} icon="user-edit" />;

type Props = {
+memberInfo: RelativeMemberInfo,
+threadInfo: ThreadInfo,
Expand Down Expand Up @@ -81,7 +84,7 @@ function ThreadMember(props: Props): React.Node {
<MenuItem
key="change_role"
text="Change Role"
icon="plus-circle"
iconComponent={commIconComponent}
onClick={onClickChangeRole}
/>
);
Expand Down

0 comments on commit 78707c7

Please sign in to comment.