feat: set role shortcut in context menu

This commit is contained in:
Tristan Yang
2023-06-09 16:38:26 +08:00
parent a81c087163
commit ffe4d83c6c
5 changed files with 48 additions and 10 deletions
+8 -1
View File
@@ -28,7 +28,10 @@ const UserContextMenu: FC<Props> = ({ enable = false, uid, cid, visible, hide, c
canBlock,
canRemoveFromChannel,
removeFromChannel,
removeUser
removeUser,
isAdmin,
canUpdateRole,
updateRole
} = useUserOperation({
uid,
cid
@@ -56,6 +59,10 @@ const UserContextMenu: FC<Props> = ({ enable = false, uid, cid, visible, hide, c
title: t("copy_email"),
handler: copyEmail
},
canUpdateRole && {
title: isAdmin ? t("set_normal") : t("set_admin"),
handler: updateRole
},
canRemoveFromChannel && {
danger: true,
title: t("remove_from_channel"),