From 5fa96315e39841ec67d56aa08d0a2a0060aa2357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marina=20L=C3=B3pez?= Date: Fri, 7 Feb 2025 09:51:25 +0100 Subject: [PATCH] :sparkles: Add event for A/B test first state project (#5791) --- frontend/src/app/main/ui/dashboard/placeholder.cljs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/dashboard/placeholder.cljs b/frontend/src/app/main/ui/dashboard/placeholder.cljs index 8af3d723b..d836fcf24 100644 --- a/frontend/src/app/main/ui/dashboard/placeholder.cljs +++ b/frontend/src/app/main/ui/dashboard/placeholder.cljs @@ -8,19 +8,29 @@ (:require-macros [app.main.style :as stl]) (:require [app.config :as cf] + [app.main.data.event :as ev] + [app.main.store :as st] [app.main.ui.dashboard.import :as udi] [app.main.ui.ds.product.empty-placeholder :refer [empty-placeholder*]] [app.main.ui.ds.product.loader :refer [loader*]] [app.main.ui.icons :as i] [app.util.dom :as dom] [app.util.i18n :as i18n :refer [tr]] + [potok.v2.core :as ptk] [rumext.v2 :as mf])) (mf/defc empty-placeholder-projects* {::mf/wrap-props false} [{:keys [on-create on-finish-import project-id] :as props}] (let [file-input (mf/use-ref nil) - on-add-library (mf/use-fn #(dom/open-new-window "https://penpot.app/penpothub/libraries-templates")) + on-add-library (mf/use-fn + (fn [event] + (dom/prevent-default event) + (dom/stop-propagation event) + (st/emit! (ptk/event ::ev/event {::ev/name "explore-libraries-click" + ::ev/origin "dashboard" + :section "empty-placeholder-projects"})) + (dom/open-new-window "https://penpot.app/penpothub/libraries-templates"))) on-import-files (mf/use-fn #(dom/click (mf/ref-val file-input)))] [:div {:class (stl/css :empty-project-container)}