mirror of
https://github.com/penpot/penpot.git
synced 2026-05-01 14:18:07 +00:00
✨ Use Nitrate license to decide org selector visibility
This commit is contained in:
parent
4345cfaec7
commit
bc3ba80848
@ -595,9 +595,7 @@
|
||||
(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)
|
||||
has-nitrate? (dnt/is-valid-license? profile)
|
||||
|
||||
current-org (team->org team)
|
||||
|
||||
@ -634,16 +632,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 has-nitrate?
|
||||
[:div {:class (stl/css :sidebar-org-switch)}
|
||||
|
||||
[:button {:class (stl/css :current-org)
|
||||
@ -675,7 +664,16 @@
|
||||
: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]}]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user