From 0c8448c65d1256be4ce819bf5f820bcabecfbb91 Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Thu, 9 Feb 2023 12:55:47 +0000 Subject: [PATCH] The side menu now only shows the workflows tab if you have 0 workflows --- .../app/components/navigation/SideMenu.tsx | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/apps/webapp/app/components/navigation/SideMenu.tsx b/apps/webapp/app/components/navigation/SideMenu.tsx index a74ff7ca315..1a7d71488d7 100644 --- a/apps/webapp/app/components/navigation/SideMenu.tsx +++ b/apps/webapp/app/components/navigation/SideMenu.tsx @@ -44,29 +44,35 @@ export function OrganizationsSideMenu() { return null; } - const items: SideMenuItem[] = [ + let items: SideMenuItem[] = [ { name: "Workflows", icon: , to: `/orgs/${currentOrganization.slug}`, }, - { - name: "API Integrations", - icon: , - to: `/orgs/${currentOrganization.slug}/integrations`, - }, - { - name: "Team", - icon: , - to: `/orgs/${currentOrganization.slug}/members`, - }, - { - name: "New Workflow", - icon: , - to: `/orgs/${currentOrganization.slug}/workflows/new`, - }, ]; + if (currentOrganization.workflows.length > 0) { + items = [ + ...items, + { + name: "API Integrations", + icon: , + to: `/orgs/${currentOrganization.slug}/integrations`, + }, + { + name: "Team", + icon: , + to: `/orgs/${currentOrganization.slug}/members`, + }, + { + name: "New Workflow", + icon: , + to: `/orgs/${currentOrganization.slug}/workflows/new`, + }, + ]; + } + return ( );