diff --git a/web/components/workspace/sidebar-quick-action.tsx b/web/components/workspace/sidebar-quick-action.tsx index 6427e4692..d2245090f 100644 --- a/web/components/workspace/sidebar-quick-action.tsx +++ b/web/components/workspace/sidebar-quick-action.tsx @@ -10,6 +10,8 @@ import { CreateUpdateDraftIssueModal } from "components/issues"; import { useMobxStore } from "lib/mobx/store-provider"; import { observer } from "mobx-react-lite"; import { EProjectStore } from "store/command-palette.store"; +// constants +import { EUserWorkspaceRoles } from "constants/workspace"; export const WorkspaceSidebarQuickAction = observer(() => { // states @@ -19,12 +21,15 @@ export const WorkspaceSidebarQuickAction = observer(() => { theme: themeStore, commandPalette: commandPaletteStore, trackEvent: { setTrackElement }, + user: { currentWorkspaceRole }, } = useMobxStore(); const { storedValue, clearValue } = useLocalStorage("draftedIssue", JSON.stringify({})); const isSidebarCollapsed = themeStore.sidebarCollapsed; + const isAuthorizedUser = !!currentWorkspaceRole && currentWorkspaceRole >= EUserWorkspaceRoles.MEMBER; + return ( <> { isSidebarCollapsed ? "flex-col gap-1" : "gap-2" }`} > -
- + - {storedValue && Object.keys(JSON.parse(storedValue)).length > 0 && ( - <> -
+ {storedValue && Object.keys(JSON.parse(storedValue)).length > 0 && ( + <> +
- + -
-
- +
+
+ +
-
- - )} -
+ + )} +
+ )}