🎉 Test A/B for starting with light theme

This commit is contained in:
Pablo Alba 2024-08-16 10:28:01 +02:00
parent 380ead2ad6
commit b0af94415f
4 changed files with 21 additions and 7 deletions

View file

@ -19,6 +19,7 @@
[app.main.data.websocket :as ws]
[app.main.features :as features]
[app.main.repo :as rp]
[app.util.dom :as dom]
[app.util.i18n :as i18n :refer [tr]]
[app.util.router :as rt]
[app.util.storage :refer [storage]]
@ -135,7 +136,8 @@
(swap! storage assoc :profile profile)
(i18n/set-locale! (:lang profile))
(when (not= previous-email email)
(set-current-team! nil)))))))
(set-current-team! nil))
(dom/set-html-theme-color (or (:theme profile) "default")))))))
(defn fetch-profile
[]

View file

@ -49,11 +49,16 @@
(not= section :auth-register-success))
params (:query-params route)
error (:error params)
hide-image-auth? (cf/external-feature-flag "signup-01" "test")]
hide-image-auth? (cf/external-feature-flag "signup-01" "test")
default-light? (cf/external-feature-flag "onboarding-02" "test")]
(mf/with-effect []
(dom/set-html-title (tr "title.default")))
(mf/with-effect [default-light?]
(when default-light?
(dom/set-html-theme-color "light")))
(mf/with-effect [error]
(when error
(st/emit! (du/show-redirect-error error))))

View file

@ -227,6 +227,7 @@
:initial params)
submitted? (mf/use-state false)
theme (when (cf/external-feature-flag "onboarding-02" "test") "light")
on-success
(mf/use-fn
@ -245,7 +246,8 @@
(mf/use-fn
(fn [form _]
(reset! submitted? true)
(let [params (:clean-data @form)]
(let [params (cond-> (:clean-data @form)
(some? theme) (assoc :theme theme))]
(->> (rp/cmd! :register-profile params)
(rx/finalize #(reset! submitted? false))
(rx/subs! on-success on-error)))))]