mirror of
https://github.com/penpot/penpot.git
synced 2025-01-27 17:09:08 -05:00
✨ Assign profile avatar on profile update.
This commit is contained in:
parent
f4f79008a4
commit
f2e4417d87
2 changed files with 5 additions and 4 deletions
|
@ -15,6 +15,7 @@
|
||||||
[uxbox.main.repo :as rp]
|
[uxbox.main.repo :as rp]
|
||||||
[uxbox.util.i18n :as i18n :refer [tr]]
|
[uxbox.util.i18n :as i18n :refer [tr]]
|
||||||
[uxbox.util.storage :refer [storage]]
|
[uxbox.util.storage :refer [storage]]
|
||||||
|
[uxbox.util.avatars :as avatars]
|
||||||
[uxbox.util.theme :as theme]))
|
[uxbox.util.theme :as theme]))
|
||||||
|
|
||||||
;; --- Common Specs
|
;; --- Common Specs
|
||||||
|
@ -48,9 +49,10 @@
|
||||||
(ptk/reify ::profile-fetched
|
(ptk/reify ::profile-fetched
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(assoc state :profile (cond-> data
|
(let [profile (avatars/assign data)]
|
||||||
(nil? (:lang data)) (assoc :lang cfg/default-language)
|
(assoc state :profile (cond-> profile
|
||||||
(nil? (:theme data)) (assoc :theme cfg/default-theme))))
|
(nil? (:lang data)) (assoc :lang cfg/default-language)
|
||||||
|
(nil? (:theme data)) (assoc :theme cfg/default-theme)))))
|
||||||
|
|
||||||
ptk/EffectEvent
|
ptk/EffectEvent
|
||||||
(effect [_ state stream]
|
(effect [_ state stream]
|
||||||
|
|
|
@ -58,7 +58,6 @@
|
||||||
(let [locale (i18n/use-locale)
|
(let [locale (i18n/use-locale)
|
||||||
form (fm/use-form ::profile-form #(deref refs/profile))
|
form (fm/use-form ::profile-form #(deref refs/profile))
|
||||||
data (:data form)]
|
data (:data form)]
|
||||||
(prn "data" form)
|
|
||||||
[:form.profile-form {:on-submit #(on-submit % form)}
|
[:form.profile-form {:on-submit #(on-submit % form)}
|
||||||
[:span.settings-label (t locale "settings.profile.section-basic-data")]
|
[:span.settings-label (t locale "settings.profile.section-basic-data")]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue