From 8cc6c40b87f514931091f7667f56e4193fec245f Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Fri, 27 Mar 2026 09:51:20 +0100 Subject: [PATCH] :sparkles: Update nitrate organizations dropdown visibility --- .../src/app/main/ui/dashboard/sidebar.cljs | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/frontend/src/app/main/ui/dashboard/sidebar.cljs b/frontend/src/app/main/ui/dashboard/sidebar.cljs index f944e07e94..15f3aef434 100644 --- a/frontend/src/app/main/ui/dashboard/sidebar.cljs +++ b/frontend/src/app/main/ui/dashboard/sidebar.cljs @@ -593,9 +593,8 @@ (map team->org) (d/index-by :id))) - ;; There is always at least one default organization - ;; so no-orgs? is true when only that default one exists (count <= 1). - no-orgs? (<= (count orgs) 1) + show-dropdown? (or (dnt/is-valid-license? profile) + (> (count orgs) 1)) current-org (team->org team) @@ -632,16 +631,7 @@ (if (dnt/is-valid-license? profile) (dnt/go-to-nitrate-cc-create-org) (st/emit! (dnt/show-nitrate-popup :nitrate-form)))))] - (if no-orgs? - [:div {:class (stl/css :nitrate-selected-org)} - [:span {:class (stl/css :nitrate-penpot-icon)} - [:> raw-svg* {:id penpot-logo-icon}]] - "Penpot" - [:> button* {:variant "ghost" - :type "button" - :class (stl/css :nitrate-create-org) - :on-click on-create-org-click} (tr "dashboard.plus-create-new-org")]] - + (if show-dropdown? [:div {:class (stl/css :sidebar-org-switch)} [:button {:class (stl/css :current-org) @@ -669,7 +659,15 @@ :class (stl/css :dropdown :teams-dropdown) :organization current-org :profile profile - :organizations orgs}]]))) + :organizations orgs}]] + [:div {:class (stl/css :nitrate-selected-org)} + [:span {:class (stl/css :nitrate-penpot-icon)} + [:> raw-svg* {:id penpot-logo-icon}]] + "Penpot" + [:> button* {:variant "ghost" + :type "button" + :class (stl/css :nitrate-create-org) + :on-click on-create-org-click} (tr "dashboard.plus-create-new-org")]]))) (mf/defc sidebar-team-switch* [{:keys [team profile]}]