mirror of
https://github.com/penpot/penpot.git
synced 2026-09-10 22:19:19 +00:00
✨ Update nitrate organizations dropdown visibility
This commit is contained in:
parent
1ecfbef6fb
commit
8cc6c40b87
@ -593,9 +593,8 @@
|
|||||||
(map team->org)
|
(map team->org)
|
||||||
(d/index-by :id)))
|
(d/index-by :id)))
|
||||||
|
|
||||||
;; There is always at least one default organization
|
show-dropdown? (or (dnt/is-valid-license? profile)
|
||||||
;; so no-orgs? is true when only that default one exists (count <= 1).
|
(> (count orgs) 1))
|
||||||
no-orgs? (<= (count orgs) 1)
|
|
||||||
|
|
||||||
current-org (team->org team)
|
current-org (team->org team)
|
||||||
|
|
||||||
@ -632,16 +631,7 @@
|
|||||||
(if (dnt/is-valid-license? profile)
|
(if (dnt/is-valid-license? profile)
|
||||||
(dnt/go-to-nitrate-cc-create-org)
|
(dnt/go-to-nitrate-cc-create-org)
|
||||||
(st/emit! (dnt/show-nitrate-popup :nitrate-form)))))]
|
(st/emit! (dnt/show-nitrate-popup :nitrate-form)))))]
|
||||||
(if no-orgs?
|
(if show-dropdown?
|
||||||
[: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")]]
|
|
||||||
|
|
||||||
[:div {:class (stl/css :sidebar-org-switch)}
|
[:div {:class (stl/css :sidebar-org-switch)}
|
||||||
|
|
||||||
[:button {:class (stl/css :current-org)
|
[:button {:class (stl/css :current-org)
|
||||||
@ -669,7 +659,15 @@
|
|||||||
:class (stl/css :dropdown :teams-dropdown)
|
:class (stl/css :dropdown :teams-dropdown)
|
||||||
:organization current-org
|
:organization current-org
|
||||||
:profile profile
|
: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*
|
(mf/defc sidebar-team-switch*
|
||||||
[{:keys [team profile]}]
|
[{:keys [team profile]}]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user