From 91d7d78621917b0076d51386bf7c83ed502d741a Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Sat, 29 Jan 2022 14:30:42 +0530 Subject: [PATCH] Open space options on right click pinned space icon Signed-off-by: Ajay Bura --- .../molecules/sidebar-avatar/SidebarAvatar.jsx | 6 +++++- src/app/organisms/navigation/SideBar.jsx | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/app/molecules/sidebar-avatar/SidebarAvatar.jsx b/src/app/molecules/sidebar-avatar/SidebarAvatar.jsx index e67b69fd..39238a5e 100644 --- a/src/app/molecules/sidebar-avatar/SidebarAvatar.jsx +++ b/src/app/molecules/sidebar-avatar/SidebarAvatar.jsx @@ -12,7 +12,8 @@ import { blurOnBubbling } from '../../atoms/button/script'; const SidebarAvatar = React.forwardRef(({ tooltip, text, bgColor, imageSrc, - iconSrc, active, onClick, isUnread, notificationCount, isAlert, + iconSrc, active, onClick, onContextMenu, + isUnread, notificationCount, isAlert, }, ref) => { let activeClass = ''; if (active) activeClass = ' sidebar-avatar--active'; @@ -27,6 +28,7 @@ const SidebarAvatar = React.forwardRef(({ type="button" onMouseUp={(e) => blurOnBubbling(e, '.sidebar-avatar')} onClick={onClick} + onContextMenu={onContextMenu} > { + e.preventDefault(); + openReusableContextMenu( + 'right', + getEventCords(e, '.sidebar-avatar'), + (closeMenu) => , + ); + }; + function getHomeNoti() { const orphans = roomList.getOrphans(); let noti = null; @@ -174,6 +185,7 @@ function SideBar() { notificationCount={abbreviateNumber(notifications.getTotalNoti(sRoomId))} isAlert={notifications.getHighlightNoti(sRoomId) !== 0} onClick={() => selectTab(shortcut)} + onContextMenu={(e) => openSpaceOptions(e, sRoomId)} /> ); })