add - nettoayge & refacto du layout
This commit is contained in:
1 parent
811c6d362b
commit
769d441270
16 files changed
+368
-414
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { getSession } from 'next-auth/react';
|
||||
import prisma from '../../../lib/prisma'
|
||||
import prisma from '../../../../lib/prisma'
|
||||
|
||||
|
||||
// DELETE /api/post/:id
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
import prisma from '../../../lib/prisma'
|
||||
import prisma from '../../../../lib/prisma'
|
||||
import { getSession } from 'next-auth/react'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
import prisma from '../../../lib/prisma'
|
||||
import prisma from '../../../../lib/prisma'
|
||||
import { getSession } from 'next-auth/react'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { getSession } from 'next-auth/react';
|
||||
import prisma from '../../../lib/prisma'
|
||||
import prisma from '../../../../lib/prisma'
|
||||
|
||||
// PUT /api/publish/:id
|
||||
export default async function handle(req: NextApiRequest, res: NextApiResponse) {
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useState } from "react";
|
||||
import Layout from "../components/Layout";
|
||||
import Layout from "../../components/Layout";
|
||||
import Router from "next/router";
|
||||
|
||||
const Draft = () => {
|
||||
@@ -1,9 +1,9 @@
|
||||
import React from "react";
|
||||
import { GetServerSideProps } from "next";
|
||||
import Layout from "../components/Layout";
|
||||
import Post, { PostProps } from "../components/Post";
|
||||
import Layout from "../../components/Layout";
|
||||
import Post, { PostProps } from "../../components/Post";
|
||||
import { useSession, getSession } from "next-auth/react";
|
||||
import prisma from '../lib/prisma'
|
||||
import prisma from '../../lib/prisma'
|
||||
|
||||
|
||||
export const getServerSideProps: GetServerSideProps = async ({ req, res }) => {
|
||||
@@ -33,8 +33,8 @@ type Props = {
|
||||
drafts: PostProps[];
|
||||
};
|
||||
|
||||
const Drafts = (props : Props) => {
|
||||
const {data: session}= useSession();
|
||||
const Drafts = (props: Props) => {
|
||||
const { data: session } = useSession();
|
||||
|
||||
if (!session) {
|
||||
return (
|
||||
@@ -1,10 +1,10 @@
|
||||
import React from "react";
|
||||
import { GetServerSideProps } from "next";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import Layout from "../../components/Layout";
|
||||
import Layout from "../../../components/Layout";
|
||||
import Router from "next/router";
|
||||
import { PostProps } from "../../components/Post";
|
||||
import prisma from '../../lib/prisma'
|
||||
import { PostProps } from "../../../components/Post";
|
||||
import prisma from '../../../lib/prisma'
|
||||
import { useSession } from "next-auth/react";
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ async function deletePost(id: number): Promise<void> {
|
||||
await Router.push("/")
|
||||
}
|
||||
|
||||
const Post = (props : PostProps) => {
|
||||
const Post = (props: PostProps) => {
|
||||
const { data: session, status } = useSession();
|
||||
if (status === 'loading') {
|
||||
return <div>Authenticating ...</div>;
|
||||
@@ -1,10 +1,10 @@
|
||||
import React, { useState } from "react";
|
||||
import { GetServerSideProps } from "next";
|
||||
import Layout from "../components/Layout";
|
||||
import Layout from "../../components/Layout";
|
||||
import { useSession, getSession } from "next-auth/react";
|
||||
import prisma from '../lib/prisma'
|
||||
import prisma from '../../lib/prisma'
|
||||
import Router from "next/router";
|
||||
import { ProfileProps } from "../types/profile";
|
||||
import { ProfileProps } from "../../types/profile";
|
||||
import { Resolver, SubmitHandler } from "react-hook-form";
|
||||
|
||||
|
||||
+49
-40
@@ -130,47 +130,56 @@ const MainPage = ({ csrfToken }: Props) => {
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="" />
|
||||
</Head>
|
||||
<div className={`${style['bloc-content']} col-12 col-lg-6`}>
|
||||
<h1 className="fw-light">Connexion</h1>
|
||||
|
||||
<SiGnuprivacyguard size={50} />
|
||||
<form onSubmit={handleSubmit(onMailSubmit)}>
|
||||
<div className="form-group mx-auto my-3 w-100">
|
||||
<input
|
||||
type="email" id="email" name="email"
|
||||
className={`mb-3 form-control ${errors.email ? 'is-invalid' : ''}`}
|
||||
placeholder="Email..."
|
||||
{...register("email")}
|
||||
/>
|
||||
<div className="d-grid">
|
||||
<button type="submit" className="btn d-grid btn-primary">
|
||||
Se connecter avec mon email
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div className="d-grid">
|
||||
<button onClick={connexionWithGoogle} type="button" className={`btn btn-primary ${style.loginButton}`} style={{ backgroundColor: "#dd4b39" }}>
|
||||
<span className={style.logo}><AiOutlineGoogle /></span>Se connecter avec google
|
||||
</button>
|
||||
</div>
|
||||
<div className="form-group">
|
||||
<label
|
||||
htmlFor="acceptTerms"
|
||||
className="form-check-label"
|
||||
>
|
||||
J'ai lu et j'accepte les
|
||||
conditions
|
||||
</label>
|
||||
<input
|
||||
type="checkbox"
|
||||
className={`form-check-input ${errors.acceptTerms ? 'is-invalid' : ''}`}
|
||||
{...register("acceptTerms")}
|
||||
name="acceptTerms"
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
</div >
|
||||
<div className={`${style['masthead']} d-flex justify-content-center align-items-center text-center`}>
|
||||
<div className="container align-items-center d-flex flex-column">
|
||||
|
||||
|
||||
|
||||
<div className={`${style['bloc-content']} col-12 col-lg-6`}>
|
||||
<h1 className="fw-light">Connexion</h1>
|
||||
|
||||
<SiGnuprivacyguard size={50} />
|
||||
<form onSubmit={handleSubmit(onMailSubmit)}>
|
||||
<div className="form-group mx-auto my-3 w-100">
|
||||
<input
|
||||
type="email" id="email" name="email"
|
||||
className={`mb-3 form-control ${errors.email ? 'is-invalid' : ''}`}
|
||||
placeholder="Email..."
|
||||
{...register("email")}
|
||||
/>
|
||||
<div className="d-grid">
|
||||
<button type="submit" className="btn d-grid btn-primary">
|
||||
Se connecter avec mon email
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div className="d-grid">
|
||||
<button onClick={connexionWithGoogle} type="button" className={`btn btn-primary ${style.loginButton}`} style={{ backgroundColor: "#dd4b39" }}>
|
||||
<span className={style.logo}><AiOutlineGoogle /></span>Se connecter avec google
|
||||
</button>
|
||||
</div>
|
||||
<div className="form-group">
|
||||
<label
|
||||
htmlFor="acceptTerms"
|
||||
className="form-check-label"
|
||||
>
|
||||
J'ai lu et j'accepte les
|
||||
conditions
|
||||
</label>
|
||||
<input
|
||||
type="checkbox"
|
||||
className={`form-check-input ${errors.acceptTerms ? 'is-invalid' : ''}`}
|
||||
{...register("acceptTerms")}
|
||||
name="acceptTerms"
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
</div >
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</>)
|
||||
};
|
||||
|
||||
|
||||
+65
-20
@@ -10,8 +10,8 @@ import { yupResolver } from "@hookform/resolvers/yup";
|
||||
import { useForm } from "react-hook-form";
|
||||
import Router from "next/router";
|
||||
|
||||
import Section from '../components/Section';
|
||||
import style from '../styles/index.module.css';
|
||||
|
||||
import style from '../styles/Index.module.css';
|
||||
|
||||
import rotatingLeftImage from '../public/images/coffret-degustation-mousselines-individuelles-n3-PhotoRoom.webp';
|
||||
import rotatingRightImage from '../public/images/coffret-the-PhotoRoom.webp';
|
||||
@@ -23,6 +23,7 @@ import feuilleDroite from '../public/images/feuilleBasDroite.webp'
|
||||
import unAnDeThe from '../public/images/unandethé.webp'
|
||||
import sablier from '../public/images/sablier.webp'
|
||||
import cadeau from '../public/images/cadeau.webp'
|
||||
import footerGrass from '../public/images/footer_image.webp'
|
||||
import jeuConcours from '../public/images/jeuconcours.webp'
|
||||
import { GetServerSideProps } from "next";
|
||||
|
||||
@@ -108,31 +109,75 @@ const MainPage = () => {
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="" />
|
||||
</Head>
|
||||
|
||||
<div className={`${style['bloc-content']} col-12 col-lg-6`}>
|
||||
<div className={`${style['imageWrapper']}`}>
|
||||
<div className={`${style['masthead']} d-flex justify-content-center align-items-center text-center`}>
|
||||
<div className={`${style['feuilleGauche']}`}>
|
||||
<Image
|
||||
src={testerCodeCadeau}
|
||||
alt="thetiptop navigation logo"
|
||||
src={feuilleGauche}
|
||||
alt="thetiptop feuille Gauche"
|
||||
layout="responsive"
|
||||
className={`${style['rotatingImage']}`}
|
||||
className={`${style['rotatingSlow']}`}
|
||||
/>
|
||||
</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' : ''}`}
|
||||
<div className={`${style['feuilleDroite']}`}>
|
||||
<Image
|
||||
src={feuilleDroite}
|
||||
alt="thetiptop feuille Droite"
|
||||
layout="responsive"
|
||||
className={`${style['rotatingSlow']}`}
|
||||
/>
|
||||
</div>
|
||||
<div className={`${style['jeuConcours']}`}>
|
||||
<Image
|
||||
src={jeuConcours}
|
||||
alt="thetiptop jeu Concours"
|
||||
layout="responsive"
|
||||
className={`${style['zoomInOutCadeau']}`}
|
||||
/>
|
||||
</div>
|
||||
<div className={`${style['cadeau']}`}>
|
||||
<Image
|
||||
src={cadeau}
|
||||
alt="thetiptop cadeau"
|
||||
layout="responsive"
|
||||
className={`${style['zoomInOutJeuConcours']}`}
|
||||
/>
|
||||
</div>
|
||||
<div className="container align-items-center d-flex flex-column">
|
||||
<div className={`${style['bloc-content']} col-12 col-lg-6`}>
|
||||
<div className={`${style['imageWrapper']}`}>
|
||||
<Image
|
||||
src={testerCodeCadeau}
|
||||
alt="thetiptop navigation logo"
|
||||
layout="responsive"
|
||||
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 alert alert-danger">{errors.codeCadeau?.message}</div>
|
||||
</div>
|
||||
<div className="form-group mx-auto my-3 w-100">
|
||||
<button type="submit" className={`${style['aButton']} btn btn-primary`}>Découvrir mon cadeau !</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div className={`${style['footerGrass']}`}>
|
||||
<Image
|
||||
src={footerGrass}
|
||||
alt="thetiptop feuille Gauche"
|
||||
layout="responsive"
|
||||
// className={`${style['footerGrass']}`}
|
||||
/>
|
||||
<small id="codeHelp" className="form-text text-muted">Code à usage unique</small>
|
||||
<div className="invalid-feedback alert alert-danger">{errors.codeCadeau?.message}</div>
|
||||
</div>
|
||||
<div className="form-group mx-auto my-3 w-100">
|
||||
<button type="submit" className={`${style['aButton']} btn btn-primary`}>Découvrir mon cadeau !</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -44,15 +44,22 @@ const VerifyRequest = () => {
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="" />
|
||||
</Head>
|
||||
<div className={`${style['bloc-content']} col-12 col-lg-6`}>
|
||||
<h1 className="fw-light">Un email a été envoyé</h1>
|
||||
<GrValidate size={100} />
|
||||
<div className="d-grid mt-4">
|
||||
<button onClick={() => Router.push("/")} type="button" className={`btn btn-primary`}>
|
||||
Cliquez ici si vous n'êtes pas rediriger à l'accueil
|
||||
</button>
|
||||
|
||||
<div className={`${style['masthead']} d-flex justify-content-center align-items-center text-center`}>
|
||||
<div className="container align-items-center d-flex flex-column">
|
||||
|
||||
|
||||
<div className={`${style['bloc-content']} col-12 col-lg-6`}>
|
||||
<h1 className="fw-light">Un email a été envoyé</h1>
|
||||
<GrValidate size={100} />
|
||||
<div className="d-grid mt-4">
|
||||
<button onClick={() => Router.push("/")} type="button" className={`btn btn-primary`}>
|
||||
Cliquez ici si vous n'êtes pas rediriger à l'accueil
|
||||
</button>
|
||||
</div>
|
||||
</div >
|
||||
</div>
|
||||
</div >
|
||||
</div>
|
||||
</>)
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user