From 4e6217597ca196fe0e802f9fc80782b66e2ac973 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Sat, 18 Jun 2022 09:06:46 +0200 Subject: [PATCH] =?UTF-8?q?feat(dashboard):=20=E2=99=BF=EF=B8=8F=20Hide=20?= =?UTF-8?q?create=20buttons=20for=20guests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/dashboard/FolderContent.tsx | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/apps/builder/components/dashboard/FolderContent.tsx b/apps/builder/components/dashboard/FolderContent.tsx index a33baf26d..315446bdf 100644 --- a/apps/builder/components/dashboard/FolderContent.tsx +++ b/apps/builder/components/dashboard/FolderContent.tsx @@ -1,4 +1,4 @@ -import { DashboardFolder } from 'db' +import { DashboardFolder, WorkspaceRole } from 'db' import { Flex, Heading, @@ -34,7 +34,7 @@ const dragDistanceTolerance = 20 export const FolderContent = ({ folder }: Props) => { const { user } = useUser() - const { workspace } = useWorkspace() + const { workspace, currentRole } = useWorkspace() const [isCreatingFolder, setIsCreatingFolder] = useState(false) const { setDraggedTypebot, @@ -170,17 +170,21 @@ export const FolderContent = ({ folder }: Props) => { {folder && } - + {currentRole !== WorkspaceRole.GUEST && ( + + )} - + {currentRole !== WorkspaceRole.GUEST && ( + + )} {isFolderLoading && } {folders && folders.map((folder) => (