Skip to content

Commit 9967560

Browse files
authored
fix: Do not show menu for non-admin user(ChannelSettings)(#300)
1 parent 376d6fd commit 9967560

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/smart-components/ChannelSettings/components/ModerationPanel/MemberList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const MemberList = (): ReactElement => {
7070
user={member}
7171
currentUser={sdk.currentUser.userId}
7272
action={
73-
(userId !== member.userId)
73+
(channel?.myRole === 'operator' && userId !== member.userId)
7474
? ({ actionRef, parentRef }) => (
7575
<ContextMenu
7676
menuTrigger={(toggleDropdown) => (

src/smart-components/ChannelSettings/components/UserListItem/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ const UserListItem = ({
5252
COMPONENT_NAME, ...injectingClassNames,
5353
].join(' ')}
5454
>
55-
{
56-
user.isMuted && (
57-
<MutedAvatarOverlay />
58-
)
59-
}
6055
<ContextMenu
6156
menuTrigger={(toggleDropdown) => (
6257
<Avatar
@@ -100,6 +95,11 @@ const UserListItem = ({
10095
</MenuItems>
10196
)}
10297
/>
98+
{
99+
user.isMuted && (
100+
<MutedAvatarOverlay />
101+
)
102+
}
103103
<Label
104104
className={`${COMPONENT_NAME}__title`}
105105
type={LabelTypography.SUBTITLE_1}
@@ -137,7 +137,7 @@ const UserListItem = ({
137137
{
138138
action && (
139139
<div ref={actionRef} className={`${COMPONENT_NAME}__action`}>
140-
{ action({ actionRef, parentRef }) }
140+
{action({ actionRef, parentRef })}
141141
</div>
142142
)
143143
}

src/ui/UserListItem/index.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@
1515
position: absolute;
1616
top: 8px;
1717
left: 0px;
18-
z-index: 1;
1918
cursor: pointer;
2019
}
2120

2221
.sendbird-muted-avatar {
2322
position: absolute;
2423
top: 8px;
2524
left: 0px;
26-
z-index: 2;
2725
pointer-events: none;
2826
}
2927

0 commit comments

Comments
 (0)