mirror of
https://github.com/penpot/penpot.git
synced 2025-05-26 05:56:11 +02:00
Merge pull request #2386 from penpot/palba-newsletter-subscription-st
✨ Newsletter suscription
This commit is contained in:
commit
50af997f55
5 changed files with 19 additions and 35 deletions
|
@ -32,7 +32,7 @@
|
|||
(fn []
|
||||
(st/emit! (dm/success message)
|
||||
(modal/show {:type :onboarding-team})
|
||||
(du/update-profile-props {:newsletter-updates true :newsletter-news true}))))]
|
||||
(du/update-profile-props {:newsletter-updates @newsletter-updates :newsletter-news @newsletter-news}))))]
|
||||
|
||||
[:div.modal-overlay
|
||||
[:div.modal-container.onboarding.newsletter.animated.fadeInDown
|
||||
|
|
|
@ -42,13 +42,7 @@
|
|||
(mf/defc profile-form
|
||||
[]
|
||||
(let [profile (mf/deref refs/profile)
|
||||
initial (mf/with-memo [profile]
|
||||
(let [subscribed? (-> profile
|
||||
:props
|
||||
:newsletter-subscribed
|
||||
boolean)]
|
||||
(assoc profile :newsletter-subscribed subscribed?)))
|
||||
form (fm/use-form :spec ::profile-form :initial initial)]
|
||||
form (fm/use-form :spec ::profile-form :initial profile)]
|
||||
|
||||
[:& fm/form {:on-submit on-submit
|
||||
:form form
|
||||
|
@ -72,17 +66,6 @@
|
|||
[:a {:on-click #(modal/show! :change-email {})}
|
||||
(tr "dashboard.change-email")]]]]
|
||||
|
||||
(when (contains? @cf/flags :newsletter-subscription)
|
||||
[:div.newsletter-subs
|
||||
[:p.newsletter-title (tr "dashboard.newsletter-title")]
|
||||
[:& fm/input {:name :newsletter-subscribed
|
||||
:class "check-primary"
|
||||
:type "checkbox"
|
||||
:label (tr "dashboard.newsletter-msg")}]
|
||||
[:p.info (tr "onboarding.newsletter.privacy1")
|
||||
[:a {:target "_blank" :href "https://penpot.app/privacy.html"} (tr "onboarding.newsletter.policy")]]
|
||||
[:p.info (tr "onboarding.newsletter.privacy2")]])
|
||||
|
||||
[:& fm/submit-button
|
||||
{:label (tr "dashboard.save-settings")
|
||||
:disabled (empty? (:touched @form))}]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue