Add A/B test switching '+' to 'Add file' on hover (#5705)

This commit is contained in:
Marina López 2025-01-29 11:42:08 +01:00 committed by GitHub
parent 407b664910
commit 0768ef1b8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,7 +20,10 @@
(mf/use-fn (mf/use-fn
(mf/deps create-fn) (mf/deps create-fn)
(fn [_] (fn [_]
(create-fn "dashboard:empty-folder-placeholder")))] (create-fn "dashboard:empty-folder-placeholder")))
show-text (mf/use-state nil)
on-mouse-enter (mf/use-fn #(reset! show-text true))
on-mouse-leave (mf/use-fn #(reset! show-text nil))]
(cond (cond
(true? dragging?) (true? dragging?)
[:ul [:ul
@ -43,9 +46,15 @@
:else :else
[:div {:class (stl/css :grid-empty-placeholder)} [:div {:class (stl/css :grid-empty-placeholder)}
[:button {:class (stl/css :create-new) (if (cf/external-feature-flag "add-file-01" "test")
:on-click on-click} [:button {:class (stl/css :create-new)
(if (cf/external-feature-flag "add-file-01" "test") (tr "dashboard.add-file") i/add)]]))) :on-click on-click
:on-mouse-enter on-mouse-enter
:on-mouse-leave on-mouse-leave}
(if @show-text (tr "dashboard.add-file") i/add)]
[:button {:class (stl/css :create-new)
:on-click on-click}
i/add])])))
(mf/defc loading-placeholder (mf/defc loading-placeholder
[] []