first commit

This commit is contained in:
cedric committed 2022-11-28 23:06:53 +01:00
commit 5927d8e937
137 files changed
+8126

No files matched your search

+76
View File
@@ -0,0 +1,76 @@
import Image from 'next/image'
import logo from '../public/images/logo.webp';
import logoInstagram from '../public/images/logo instagram.webp';
import logoLinkedin from '../public/images/logo linkedin.webp';
import style from '../styles/Footer.module.css'
import Link from 'next/link';
const Footer = () => {
return (
<footer className={`${style.footer}`}>
<div className={`${style['footerContent']}`}>
<div className="container border-bottom">
<div className="row align-items-center">
<div className="col-sm-6 col-md-3 d-flex justify-content-center">
<Link href="/" passHref >
<Image
src={logo}
alt="thetiptop navigation logo"
width="110"
height="110"
/>
</Link>
</div>
<div className="col-sm-6 col-md-3">
<ul className="nav flex-column justify-content-md-around align-content-center">
<li className="nav-item px-2">
<p>18 rue Léon Frot, 75 011 Paris</p>
</li>
<li className="nav-item px-2">
<p>01.65.38.94.23</p>
</li>
<li className="nav-item px-2">
<p>contact@thetiptop.com</p>
</li>
</ul>
</div>
<div className="col-sm-6 col-md-3 d-flex justify-content-center align-items-md-baseline align-items-sm-center">
<ul className="nav flex-md-column">
<li className="nav-item py-2 px-2">
<Image src={logoInstagram} alt="lien instagram" width="40"
height="40" />
</li>
<li className="nav-item py-2 px-2">
<Image src={logoLinkedin} alt="lien linkedin" width="40"
height="40" />
</li>
</ul>
</div>
<div className="col-sm-6 col-md-3">
<ul className="nav flex-column justify-content-md-around justify-content-sm-center mx-5">
<li className="nav-item">
<Link href="/cgu" legacyBehavior >
<a className='px-2'>CGU</a>
</Link>
</li>
<li className="nav-item">
<Link href="/mentions-legales" legacyBehavior >
<a className='px-2'>Mentions légales</a>
</Link>
</li>
</ul>
</div>
</div>
<p className="text-center">Thé Tip Top © 2022 - projet fictif pour lequel aucun réel
achat ou aucune réservation ne pourrait être effectué.</p>
</div>
</div>
</footer>
);
}
export default Footer;
+17
View File
@@ -0,0 +1,17 @@
import React, { ReactNode } from "react";
import NavBar from "./NavBar";
import Footer from "./Footer";
type Props = {
children?: React.ReactNode;
};
const Layout = ({ children }: Props) =>
<div className="layout-container">
<NavBar />
{children}
<Footer />
</div>
export default Layout;
+91
View File
@@ -0,0 +1,91 @@
import React, { useRef } from "react";
import logo from '../public/images/thetiptop_logo.webp';
import Link from "next/link";
import { useRouter } from "next/router";
import { signOut, useSession } from "next-auth/react";
import style from '../styles/NavBar.module.css';
import Image from 'next/image';
import { FiArrowRight } from 'react-icons/fi';
const NavBar = () => {
const navRef = useRef<HTMLInputElement>();
const router = useRouter();
const { data: session, status } = useSession();
console.log('role', session)
const closeNav = () => {
navRef.current.style.height = "0%";
}
const openNav = () => {
navRef.current.style.height = "100%";
}
let visitor = (
<nav className={`${style['navbar']}`}>
<div className="d-flex justify-content-center">
<Image
src={logo}
alt="thetiptop navigation logo big"
width={250}
height={100}
/>
</div>
<div className={`justify-content-center text-center ${style['hidden-mobile']}`}>
<Link href="/" legacyBehavior><a className={style.link} >Accueil</a></Link> |
<Link href="/" legacyBehavior><a className={style.link} >Nos produits</a></Link> |
<Link href="/contact" legacyBehavior><a className={style.link} >Contactez-nous</a></Link> |
{!session && <Link href="/connexion" legacyBehavior><a className={style.link} >Connexion</a></Link>}
{session && <Link href="/connexion" legacyBehavior><a className={style.link} >Mon compte</a></Link>}
{session && <Link href="/" legacyBehavior><a onClick={() => signOut()} className={style.link} >Se déconnecter</a></Link>}
{session && <span className={`${style.connexion} badge rounded-pill bg-light text-dark`}><FiArrowRight />{session.user.email}</span>}
</div>
<div className={`justify-content-center text-center ${style['show-mobile']}`}>
<span className={`${style.burgerButton}`} onClick={openNav}>&#9776;</span>
</div>
<div className="d-flex justify-content-center">
</div>
<div ref={navRef} className={style.overlay} onClick={closeNav}>
<a className={style.closebtn} onClick={closeNav}>&times;</a>
<div className="overlay-content">
<Link href="/contact" legacyBehavior><a className={style.link} >Accueil</a></Link> |
<Link href="/" legacyBehavior><a className={style.link} >Nos produits</a></Link> |
<Link href="/" legacyBehavior><a className={style.link} >Contactez-nous</a></Link> |
<Link href="/connexion" legacyBehavior><a className={style.link} >Connexion</a></Link>
{session && <span className={`${style.connexion} badge rounded-pill bg-light text-dark`}><FiArrowRight />{session.user.email}</span>}
</div>
</div>
</nav>
)
return (<>
{visitor}
</>)
};
export default NavBar;
+33
View File
@@ -0,0 +1,33 @@
import React from "react";
import Router from "next/router";
import ReactMarkdown from "react-markdown";
export type PostProps = {
id: number;
title: string;
author: {
name: string;
email: string;
} | null;
content: string;
published: boolean;
};
const Post = ( {post} : {post : PostProps}) => {
const authorName = post.author ? post.author.name : "Unknown author";
return (
<div onClick={() => Router.push("/p/[id]", `/p/${post.id}`)}>
<h2>{post.title}</h2>
<small>By {authorName}</small>
<ReactMarkdown children={post.content} />
<style jsx>{`
div {
color: inherit;
padding: 2rem;
}
`}</style>
</div>
);
};
export default Post;