From 5c84ba514f49d4871730f2c8565c06c41172b34e Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Fri, 30 Oct 2020 16:28:47 -0400 Subject: [PATCH] groups: only surface invite if admin Fixes #3803. --- .../src/views/landscape/components/GroupSwitcher.tsx | 12 ++++++------ .../views/landscape/components/Sidebar/Sidebar.tsx | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/interface/src/views/landscape/components/GroupSwitcher.tsx b/pkg/interface/src/views/landscape/components/GroupSwitcher.tsx index 3ece5b214c..86afa57386 100644 --- a/pkg/interface/src/views/landscape/components/GroupSwitcher.tsx +++ b/pkg/interface/src/views/landscape/components/GroupSwitcher.tsx @@ -77,7 +77,7 @@ export function GroupSwitcher(props: { baseUrl: string; recentGroups: string[]; }) { - const { associations, workspace } = props; + const { associations, workspace, isAdmin } = props; const title = getTitleFromWorkspace(associations, workspace); const navTo = (to: string) => `${props.baseUrl}${to}`; return ( @@ -152,14 +152,14 @@ export function GroupSwitcher(props: { /> Group Settings - + {isAdmin && ( Invite to group - + )} )} @@ -173,15 +173,15 @@ export function GroupSwitcher(props: { - {workspace.type === "group" && ( + {(workspace.type === "group") && ( <> - + {isAdmin && ( - + )} diff --git a/pkg/interface/src/views/landscape/components/Sidebar/Sidebar.tsx b/pkg/interface/src/views/landscape/components/Sidebar/Sidebar.tsx index 4d751dc12e..eb2afb2a19 100644 --- a/pkg/interface/src/views/landscape/components/Sidebar/Sidebar.tsx +++ b/pkg/interface/src/views/landscape/components/Sidebar/Sidebar.tsx @@ -119,6 +119,7 @@ export function Sidebar(props: SidebarProps) { associations={associations} recentGroups={props.recentGroups} baseUrl={props.baseUrl} + isAdmin={isAdmin} workspace={props.workspace} />