|
|
|
@ -26,6 +26,8 @@ import cadeau from '../public/images/cadeau.png'
|
|
|
|
import jeuConcours from '../public/images/jeuconcours.png'
|
|
|
|
import jeuConcours from '../public/images/jeuconcours.png'
|
|
|
|
import { GetServerSideProps } from "next";
|
|
|
|
import { GetServerSideProps } from "next";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { toast } from "react-toastify";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type CodeSubmitForm = {
|
|
|
|
type CodeSubmitForm = {
|
|
|
|
@ -37,7 +39,7 @@ const MainPage = () => {
|
|
|
|
const { data: session } = useSession();
|
|
|
|
const { data: session } = useSession();
|
|
|
|
|
|
|
|
|
|
|
|
const validationSchema = Yup.object().shape({
|
|
|
|
const validationSchema = Yup.object().shape({
|
|
|
|
codeCadeau: Yup.string().trim().required("Vous n'avez pas rentrer de code cadeau !"),
|
|
|
|
codeCadeau: Yup.string().trim().required("Veuillez rentrer un code cadeau !"),
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
@ -50,6 +52,19 @@ const MainPage = () => {
|
|
|
|
|
|
|
|
|
|
|
|
const onSubmit = async (data: CodeSubmitForm) => {
|
|
|
|
const onSubmit = async (data: CodeSubmitForm) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
toast.error(errors.codeCadeau?.message, {
|
|
|
|
|
|
|
|
position: "top-center",
|
|
|
|
|
|
|
|
autoClose: 5000,
|
|
|
|
|
|
|
|
hideProgressBar: false,
|
|
|
|
|
|
|
|
closeOnClick: true,
|
|
|
|
|
|
|
|
pauseOnHover: true,
|
|
|
|
|
|
|
|
draggable: true,
|
|
|
|
|
|
|
|
progress: undefined,
|
|
|
|
|
|
|
|
theme: "light",
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!session) {
|
|
|
|
if (!session) {
|
|
|
|
return <Layout>
|
|
|
|
return <Layout>
|
|
|
|
<p>Vous devez vous connecter pour tester votre !</p>
|
|
|
|
<p>Vous devez vous connecter pour tester votre !</p>
|
|
|
|
@ -85,87 +100,32 @@ const MainPage = () => {
|
|
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="" />
|
|
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="" />
|
|
|
|
</Head>
|
|
|
|
</Head>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className={`${style['bloc-content']} col-12 col-lg-6`}>
|
|
|
|
<div className={`${style['imageWrapper']}`}>
|
|
|
|
<div className={`${style['imageWrapper']}`}>
|
|
|
|
<Image
|
|
|
|
<Image
|
|
|
|
src={testerCodeCadeau}
|
|
|
|
src={testerCodeCadeau}
|
|
|
|
alt="thetiptop navigation logo"
|
|
|
|
alt="thetiptop navigation logo"
|
|
|
|
layout="responsive"
|
|
|
|
layout="responsive"
|
|
|
|
className={`${style['rotatingImage']}`}
|
|
|
|
className={`${style['rotatingImage']}`}
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<form onSubmit={handleSubmit(onSubmit)}>
|
|
|
|
|
|
|
|
<div className="form-group mx-auto my-3 w-100">
|
|
|
|
|
|
|
|
<input type="text"
|
|
|
|
|
|
|
|
id="codeInput" aria-describedby="codeHelp"
|
|
|
|
|
|
|
|
placeholder="A293049430..."
|
|
|
|
|
|
|
|
{...register('codeCadeau')}
|
|
|
|
|
|
|
|
className={`form-control ${errors.codeCadeau ? 'is-invalid' : ''}`}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<small id="codeHelp" className="form-text text-muted">Code à usage unique</small>
|
|
|
|
|
|
|
|
<div className="invalid-feedback">{errors.codeCadeau?.message}</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="form-group mx-auto my-3 w-100">
|
|
|
|
<form onSubmit={handleSubmit(onSubmit)}>
|
|
|
|
<button type="submit" className={`${style['aButton']} btn btn-primary`}>Découvrir mon cadeau !</button>
|
|
|
|
<div className="form-group mx-auto my-3 w-100">
|
|
|
|
</div>
|
|
|
|
<input type="text"
|
|
|
|
</form>
|
|
|
|
id="codeInput" aria-describedby="codeHelp"
|
|
|
|
{/* <div className={`${style['bloc-content']} col-12 col-lg-10 d-flex row my-2 mx-0 py-2 py-lg-2 px-0 px-lg-3 `}>
|
|
|
|
placeholder="A293049430..."
|
|
|
|
<h2 className="col-12 my-2">A gagner</h2>
|
|
|
|
{...register('codeCadeau')}
|
|
|
|
<div className="col d-flex justify-content-center">
|
|
|
|
className={`form-control ${errors.codeCadeau ? 'is-invalid' : ''}`}
|
|
|
|
<div className={`${style['productToGain']}`}>
|
|
|
|
|
|
|
|
<Image
|
|
|
|
/>
|
|
|
|
src={rotatingRightImage}
|
|
|
|
<small id="codeHelp" className="form-text text-muted">Code à usage unique</small>
|
|
|
|
alt="coffret de thé marron rempli de sachets de toutes couleurs"
|
|
|
|
<div className="invalid-feedback alert alert-danger">{errors.codeCadeau?.message}</div>
|
|
|
|
fill
|
|
|
|
</div>
|
|
|
|
/>
|
|
|
|
<div className="form-group mx-auto my-3 w-100">
|
|
|
|
</div>
|
|
|
|
<button type="submit" className={`${style['aButton']} btn btn-primary`}>Découvrir mon cadeau !</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="col d-flex justify-content-center">
|
|
|
|
</form>
|
|
|
|
<div className={`${style['productToGain']}`}>
|
|
|
|
</div>
|
|
|
|
<Image
|
|
|
|
|
|
|
|
src={rotatingRightImage}
|
|
|
|
|
|
|
|
alt="coffret de thé marron rempli de sachets de toutes couleurs"
|
|
|
|
|
|
|
|
fill
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="col d-flex justify-content-center">
|
|
|
|
|
|
|
|
<div className={`${style['productToGain']}`}>
|
|
|
|
|
|
|
|
<Image
|
|
|
|
|
|
|
|
src={rotatingRightImage}
|
|
|
|
|
|
|
|
alt="coffret de thé marron rempli de sachets de toutes couleurs"
|
|
|
|
|
|
|
|
fill
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="col-12">
|
|
|
|
|
|
|
|
<div className='btn btn-primary my-2'>
|
|
|
|
|
|
|
|
<Link href="shop">Et bien d'autres !</Link>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div> */}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* <Section backgroundImagePath={'/images/three-cups-of-tea-steeping.png'}>
|
|
|
|
|
|
|
|
<h2>Présentation du jeu concours</h2>
|
|
|
|
|
|
|
|
<h4 className="fw-light">
|
|
|
|
|
|
|
|
Gagnez de superbes cadeaux en achetant nos produits !
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
Pour participer, il vous suffit d'effectuer un achat en boutique d'une valeur supérieure à XXX euros. Retrouvez votre code sur la facture !
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
Saisissez votre code ... Félicitations ! Vous avez gagné un cadeau ! Il nous vous reste plus qu'à le récupérer en magasin.
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
Après la [XXX période], vous participerez au jeu concours final afin de gagner XXX. Un participation par personne est comptabilisée pour le concours final.
|
|
|
|
|
|
|
|
</h4>
|
|
|
|
|
|
|
|
</Section>
|
|
|
|
|
|
|
|
<Section backgroundImagePath={'/images/top-view-of-a-tea-towel-and-container-holding-grain.png'}>
|
|
|
|
|
|
|
|
<h2>Présentation de Thé Tip Top</h2>
|
|
|
|
|
|
|
|
<h4 className="fw-light">
|
|
|
|
|
|
|
|
Thé Tip Top est une entreprise de thé [XXX ajouter des spécifications en se basant sur le cahier des charges]
|
|
|
|
|
|
|
|
</h4>
|
|
|
|
|
|
|
|
</Section> */}
|
|
|
|
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|