From df1b39256daa927e9ff7168572a0dd3e3672184d Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Thu, 14 Jul 2022 15:06:37 +0100 Subject: [PATCH] feat: show message that user can't message another --- src/lib/ContextMenus.tsx | 28 ++++++++++++++++++++-------- src/styles/_context-menu.scss | 2 +- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/lib/ContextMenus.tsx b/src/lib/ContextMenus.tsx index 90e3869c..de991c21 100644 --- a/src/lib/ContextMenus.tsx +++ b/src/lib/ContextMenus.tsx @@ -628,14 +628,26 @@ export default function ContextMenus() { }); } - if ( - user._id !== userId && - userPermissions & UserPermission.SendMessage - ) { - generateAction({ - action: "message_user", - user, - }); + if (user._id !== userId) { + if (userPermissions & UserPermission.SendMessage) { + generateAction({ + action: "message_user", + user, + }); + } else { + elements.push( + + + + + , + ); + } } for (let i = 0; i < actions.length; i++) { diff --git a/src/styles/_context-menu.scss b/src/styles/_context-menu.scss index 6fb154bf..1c0cb384 100644 --- a/src/styles/_context-menu.scss +++ b/src/styles/_context-menu.scss @@ -1,5 +1,5 @@ .preact-context-menu .context-menu { - z-index: 10000; + z-index: 9998; min-width: 190px; font-weight: 500; padding: 6px 8px;