From 5c48ac100a3208cf410537fa529cfff45e65eba5 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Sun, 17 Nov 2024 00:27:46 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(frontend)=20allow=20user=20register?= =?UTF-8?q?=20to=20beta=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I've created a beta form, allowing interested visitors to register to be a beta user. This form is yet created with Grist, could be enhance. I'll investigate using PostHog. --- .../features/home/components/IntroSlider.tsx | 20 ++++++++++++++++++- src/frontend/src/locales/de/home.json | 4 ++++ src/frontend/src/locales/en/home.json | 4 ++++ src/frontend/src/locales/fr/home.json | 4 ++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/features/home/components/IntroSlider.tsx b/src/frontend/src/features/home/components/IntroSlider.tsx index f47fa6a5..df39072d 100644 --- a/src/frontend/src/features/home/components/IntroSlider.tsx +++ b/src/frontend/src/features/home/components/IntroSlider.tsx @@ -4,11 +4,15 @@ import thirdSlide from '@/assets/intro-slider/3_resume.png' import { styled } from '@/styled-system/jsx' import { css } from '@/styled-system/css' -import { Button } from '@/primitives' +import { Button, LinkButton } from '@/primitives' import { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react' import { useState } from 'react' import { useTranslation } from 'react-i18next' +// todo - extract in a proper env variable +const BETA_USERS_FORM_URL = + 'https://grist.numerique.gouv.fr/o/docs/forms/3fFfvJoTBEQ6ZiMi8zsQwX/17' + const Heading = styled('h2', { base: { width: 'fit-content', @@ -116,6 +120,7 @@ const Slide = styled('div', { const TextAnimation = styled('div', { base: { display: 'flex', + alignItems: 'center', flexDirection: 'column', gap: '0.5rem', }, @@ -137,6 +142,7 @@ const TextAnimation = styled('div', { type Slide = { key: string img: string + isAvailableInBeta?: boolean } // todo - optimize how images are imported @@ -152,6 +158,7 @@ const SLIDES: Slide[] = [ { key: 'slide3', img: thirdSlide, + isAvailableInBeta: true, }, ] @@ -190,6 +197,17 @@ export const IntroSlider = () => { {t(`${slide.key}.title`)} {t(`${slide.key}.body`)} + {slide.isAvailableInBeta && ( + + {t('beta.text')} + + )} ))} diff --git a/src/frontend/src/locales/de/home.json b/src/frontend/src/locales/de/home.json index ec1da2ba..74c011f6 100644 --- a/src/frontend/src/locales/de/home.json +++ b/src/frontend/src/locales/de/home.json @@ -29,6 +29,10 @@ "label": "", "tooltip": "" }, + "beta": { + "text": "", + "tooltip": "" + }, "next": { "label": "", "tooltip": "" diff --git a/src/frontend/src/locales/en/home.json b/src/frontend/src/locales/en/home.json index 5a3d522d..40841203 100644 --- a/src/frontend/src/locales/en/home.json +++ b/src/frontend/src/locales/en/home.json @@ -33,6 +33,10 @@ "label": "next", "tooltip": "next" }, + "beta": { + "text": "Join the beta", + "tooltip": "Fill out the form" + }, "slide1": { "title": "Try Visio to simplify your daily tasks", "body": "Discover an intuitive and accessible solution, designed for all public agents, their partners, and much more.", diff --git a/src/frontend/src/locales/fr/home.json b/src/frontend/src/locales/fr/home.json index 7aa56c5c..875bd7f0 100644 --- a/src/frontend/src/locales/fr/home.json +++ b/src/frontend/src/locales/fr/home.json @@ -33,6 +33,10 @@ "label": "suivant", "tooltip": "suivant" }, + "beta": { + "text": "Essayer la beta", + "tooltip": "Accéder au formulaire" + }, "slide1": { "title": "Essayez Visio pour simplifier votre quotidien", "body": "Découvrez une solution intuitive et accessible, conçue pour tous les agents publics et leurs partenaires, et bien plus encore.",