From 06a7b641745253a9811b411ebfb57faa878e2f35 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Thu, 22 Oct 2020 16:32:54 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=BB=20Ressuscite=20le=20bloc=20d'inscr?= =?UTF-8?q?iption=20=C3=A0=20la=20newsletter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/components/NewsletterRegister.tsx | 64 +++++++++++++++++++ .../source/components/ui/Button/button.css | 1 + .../layout/Footer/Footer.tsx | 8 ++- 3 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 mon-entreprise/source/components/NewsletterRegister.tsx diff --git a/mon-entreprise/source/components/NewsletterRegister.tsx b/mon-entreprise/source/components/NewsletterRegister.tsx new file mode 100644 index 000000000..37abf3e26 --- /dev/null +++ b/mon-entreprise/source/components/NewsletterRegister.tsx @@ -0,0 +1,64 @@ +import { usePersistingState } from 'Components/utils/persistState' +import { TrackerContext } from 'Components/utils/withTracker' +import React, { useContext } from 'react' +import { Trans, useTranslation } from 'react-i18next' + +export default function NewsletterRegister() { + const [userIsRegistered, setUserIsRegistered] = usePersistingState( + 'app::newsletter::registered', + false + ) + const { t, i18n } = useTranslation() + const tracker = useContext(TrackerContext) + + const onSubmit = () => { + tracker.push(['trackEvent', 'Newsletter', 'registered']) + setTimeout(() => setUserIsRegistered(true), 0) + } + + if (i18n.language !== 'fr' || userIsRegistered) { + return null + } + + return ( + <> +

+ Restez informé +

+
+

+ + Inscrivez-vous à notre newsletter pour être informés des nouveautés + accéder aux nouvelles fonctionnalités en avant-première. + +

+ +
+
+ +
+ + +
+
+
+
+ + ) +} diff --git a/mon-entreprise/source/components/ui/Button/button.css b/mon-entreprise/source/components/ui/Button/button.css index c52dd18f9..6f777a187 100644 --- a/mon-entreprise/source/components/ui/Button/button.css +++ b/mon-entreprise/source/components/ui/Button/button.css @@ -169,6 +169,7 @@ } .ui__.small.button { + width: inherit; font-size: 90%; line-height: 1.2rem; transition: all 0.08s; diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/layout/Footer/Footer.tsx b/mon-entreprise/source/sites/mon-entreprise.fr/layout/Footer/Footer.tsx index 7b9ca167a..6abc00100 100644 --- a/mon-entreprise/source/sites/mon-entreprise.fr/layout/Footer/Footer.tsx +++ b/mon-entreprise/source/sites/mon-entreprise.fr/layout/Footer/Footer.tsx @@ -1,5 +1,6 @@ import PageFeedback from 'Components/Feedback/PageFeedback' import LegalNotice from 'Components/LegalNotice' +import NewsletterRegister from 'Components/NewsletterRegister' import SocialIcon from 'Components/ui/SocialIcon' import { SitePathsContext } from 'Components/utils/SitePathsContext' import React, { useContext } from 'react' @@ -33,7 +34,7 @@ const useShowFeedback = () => { ...Object.values(simulators).map(s => s.path) ].includes(currentPath) } -const Footer = () => { +export default function Footer() { const sitePaths = useContext(SitePathsContext) const showFeedback = useShowFeedback() const hrefLink = @@ -58,6 +59,10 @@ const Footer = () => {