0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 14:12:36 -05:00

Merge pull request #5468 from penpot/palba-abtest-add-library-button2

 Add test AB renaming "Libraries" to "Add library"
This commit is contained in:
Andrey Antukh 2024-12-13 12:20:56 +01:00 committed by GitHub
commit b8ebbe8c3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -89,6 +89,9 @@
reverse-sort? (= :desc ordering) reverse-sort? (= :desc ordering)
num-libs (count (mf/deref refs/workspace-libraries)) num-libs (count (mf/deref refs/workspace-libraries))
show-templates-02-test?
(and (cf/external-feature-flag "templates-02" "test") (zero? num-libs))
toggle-ordering toggle-ordering
(mf/use-fn (mf/use-fn
(mf/deps ordering) (mf/deps ordering)
@ -157,8 +160,7 @@
[:article {:class (stl/css :assets-bar)} [:article {:class (stl/css :assets-bar)}
[:div {:class (stl/css :assets-header)} [:div {:class (stl/css :assets-header)}
(when-not ^boolean read-only? (when-not ^boolean read-only?
(if (and (cf/external-feature-flag "templates-02" "test") (if show-templates-02-test?
(zero? num-libs))
[:button {:class (stl/css :add-library-button) [:button {:class (stl/css :add-library-button)
:on-click show-libraries-dialog :on-click show-libraries-dialog
:data-testid "libraries"} :data-testid "libraries"}
@ -170,6 +172,7 @@
i/library] i/library]
(tr "workspace.assets.libraries")])) (tr "workspace.assets.libraries")]))
(when-not show-templates-02-test?
[:div {:class (stl/css :search-wrapper)} [:div {:class (stl/css :search-wrapper)}
[:& search-bar {:on-change on-search-term-change [:& search-bar {:on-change on-search-term-change
:value term :value term
@ -194,7 +197,7 @@
[:> icon-button* {:variant "ghost" [:> icon-button* {:variant "ghost"
:aria-label (tr "workspace.assets.sort") :aria-label (tr "workspace.assets.sort")
:on-click toggle-ordering :on-click toggle-ordering
:icon (if reverse-sort? "asc-sort" "desc-sort")}]]] :icon (if reverse-sort? "asc-sort" "desc-sort")}]])]
[:& (mf/provider cmm/assets-filters) {:value filters} [:& (mf/provider cmm/assets-filters) {:value filters}
[:& (mf/provider cmm/assets-toggle-ordering) {:value toggle-ordering} [:& (mf/provider cmm/assets-toggle-ordering) {:value toggle-ordering}