0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 06:02:32 -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)
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
(mf/use-fn
(mf/deps ordering)
@ -157,8 +160,7 @@
[:article {:class (stl/css :assets-bar)}
[:div {:class (stl/css :assets-header)}
(when-not ^boolean read-only?
(if (and (cf/external-feature-flag "templates-02" "test")
(zero? num-libs))
(if show-templates-02-test?
[:button {:class (stl/css :add-library-button)
:on-click show-libraries-dialog
:data-testid "libraries"}
@ -170,6 +172,7 @@
i/library]
(tr "workspace.assets.libraries")]))
(when-not show-templates-02-test?
[:div {:class (stl/css :search-wrapper)}
[:& search-bar {:on-change on-search-term-change
:value term
@ -194,7 +197,7 @@
[:> icon-button* {:variant "ghost"
:aria-label (tr "workspace.assets.sort")
: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-toggle-ordering) {:value toggle-ordering}