🚸 add - grosse refonte du site
This commit is contained in:
1 parent
dfa67f86d5
commit
9e959f5ac6
50 files changed
+973
-289
No files matched your search
@@ -0,0 +1,73 @@
|
||||
import Image from 'next/image'
|
||||
import logo from '../public/images/logo.png';
|
||||
import logoInstagram from '../public/images/logo instagram.png';
|
||||
import logoLinkedin from '../public/images/logo linkedin.png';
|
||||
|
||||
import Link from 'next/link';
|
||||
|
||||
const Footer = () => {
|
||||
return (
|
||||
<footer className="py-3 my-2 my-lg-5 footer">
|
||||
<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="/" legacyBehavior>
|
||||
<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='nav-link px-2 text-muted'>CGU</a>
|
||||
</Link>
|
||||
</li>
|
||||
<li className="nav-item">
|
||||
<Link href="/mentions-legales" legacyBehavior>
|
||||
<a className='nav-link px-2 text-muted'>Mentions légales</a>
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p className="text-center text-muted">Thé Tip Top © 2022 - projet fictif pour lequel aucun réel
|
||||
achat ou aucune réservation ne pourrait être effectué.</p>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
|
||||
export default Footer;
|
||||
@@ -1,216 +0,0 @@
|
||||
import React from "react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { signOut, useSession } from "next-auth/react";
|
||||
|
||||
const Header = () => {
|
||||
const router = useRouter();
|
||||
const isActive: (pathname: string) => boolean = (pathname) =>
|
||||
router.pathname === pathname;
|
||||
|
||||
const { data: session, status } = useSession();
|
||||
|
||||
let left = (
|
||||
<div className="left">
|
||||
<Link href="/" legacyBehavior>
|
||||
<a className="bold" data-active={isActive("/")}>
|
||||
Feed
|
||||
</a>
|
||||
</Link>
|
||||
<style jsx>{`
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.left a[data-active="true"] {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
a + a {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
|
||||
let right = null;
|
||||
|
||||
if (status === 'loading') {
|
||||
left = (
|
||||
<div className="left">
|
||||
<Link href="/" legacyBehavior>
|
||||
<a className="bold" data-active={isActive("/")}>
|
||||
Feed
|
||||
</a>
|
||||
</Link>
|
||||
<style jsx>{`
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.left a[data-active="true"] {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
a + a {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
right = (
|
||||
<div className="right">
|
||||
<p>Validating session ...</p>
|
||||
<style jsx>{`
|
||||
.right {
|
||||
margin-left: auto;
|
||||
}
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (!session) {
|
||||
right = (
|
||||
<div className="right">
|
||||
<Link href="/api/auth/signin" legacyBehavior>
|
||||
<a data-active={isActive("/signup")}>Log in</a>
|
||||
</Link>
|
||||
<style jsx>{`
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
a + a {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.right a {
|
||||
border: 1px solid black;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 3px;
|
||||
}
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (session) {
|
||||
left = (
|
||||
<div className="left">
|
||||
<Link href="/" legacyBehavior>
|
||||
<a className="bold" data-active={isActive("/")}>
|
||||
Feed
|
||||
</a>
|
||||
</Link>
|
||||
<Link href="/drafts" legacyBehavior>
|
||||
<a data-active={isActive("/drafts")}>My drafts</a>
|
||||
</Link>
|
||||
<Link href="/profile" legacyBehavior>
|
||||
<a data-active={isActive("/profile")}>
|
||||
Mon Compte
|
||||
</a>
|
||||
</Link>
|
||||
<style jsx>{`
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.left a[data-active="true"] {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
a + a {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
right = (
|
||||
<div className="right">
|
||||
<p>
|
||||
{session.user.name} ({session.user.email})
|
||||
</p>
|
||||
<Link href="/create" legacyBehavior>
|
||||
<button>
|
||||
<a>New post</a>
|
||||
</button>
|
||||
</Link>
|
||||
<button onClick={() => signOut()}>
|
||||
<a>Log out</a>
|
||||
</button>
|
||||
<style jsx>{`
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
p {
|
||||
display: inline-block;
|
||||
font-size: 13px;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
a + a {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.right a {
|
||||
border: 1px solid black;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
button {
|
||||
border: none;
|
||||
}
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<nav>
|
||||
{left}
|
||||
{right}
|
||||
<style jsx>{`
|
||||
nav {
|
||||
display: flex;
|
||||
padding: 2rem;
|
||||
align-items: center;
|
||||
}
|
||||
`}</style>
|
||||
</nav>
|
||||
);
|
||||
};
|
||||
|
||||
export default Header;
|
||||
+8
-40
@@ -1,50 +1,18 @@
|
||||
import React, { ReactNode } from "react";
|
||||
import Header from "./Header";
|
||||
import NavBar from "./NavBar";
|
||||
import Footer from "./Footer";
|
||||
|
||||
|
||||
type Props = {
|
||||
children?: React.ReactNode;
|
||||
};
|
||||
|
||||
const Layout = ({ children }: Props) => (
|
||||
const Layout = ({ children }: Props) =>
|
||||
<div>
|
||||
<Header />
|
||||
<div className="layout">{children}</div>
|
||||
<style jsx global>{`
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 16px;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
||||
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
|
||||
"Segoe UI Symbol";
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
input,
|
||||
textarea {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
button {
|
||||
cursor: pointer;
|
||||
}
|
||||
`}</style>
|
||||
<style jsx>{`
|
||||
.layout {
|
||||
padding: 0 2rem;
|
||||
}
|
||||
`}</style>
|
||||
<NavBar />
|
||||
{children}
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
|
||||
export default Layout;
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
import React, { useRef } from "react";
|
||||
import logo from '../public/images/thetiptop_logo.png';
|
||||
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 { UserProps } from "../types/user";
|
||||
|
||||
|
||||
|
||||
|
||||
const NavBar = ({ role, email }: UserProps) => {
|
||||
|
||||
const navRef = useRef<HTMLInputElement>();
|
||||
|
||||
const router = useRouter();
|
||||
const { data: session, status } = useSession();
|
||||
|
||||
const closeNav = () => {
|
||||
navRef.current.style.height = "0%";
|
||||
}
|
||||
|
||||
const openNav = () => {
|
||||
navRef.current.style.height = "100%";
|
||||
}
|
||||
|
||||
let visitor = (
|
||||
<nav className={`${style.customcss} container-fluid`}>
|
||||
|
||||
<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="/contact" legacyBehavior><a className={style.link} >Nos produits</a></Link> |
|
||||
<Link href="/" legacyBehavior><a className={style.link} >Contactez-nous</a></Link> |
|
||||
<Link href="/user" legacyBehavior><a className={style.link} >Connexion</a></Link>
|
||||
</div>
|
||||
<div className={`justify-content-center text-center ${style['show-mobile']}`}>
|
||||
<span className={`${style.burgerButton}`} onClick={openNav}>☰</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div ref={navRef} className={style.overlay} onClick={closeNav}>
|
||||
|
||||
<a href="javascript:void(0)" className={style.closebtn} onClick={closeNav}>×</a>
|
||||
<div className="overlay-content">
|
||||
<a href="#">About</a>
|
||||
<a href="#">Services</a>
|
||||
<a href="#">Clients</a>
|
||||
<a href="#">Contact</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</nav>
|
||||
|
||||
)
|
||||
|
||||
return (<>
|
||||
{visitor}
|
||||
</>)
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
export default NavBar;
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
import style from "../styles/Section.module.css"
|
||||
|
||||
const Section = ({ children, backgroundImagePath, customClass = "d-flex justify-content-center text-center align-items-center" }) => {
|
||||
const isImagePath = backgroundImagePath ? { backgroundImage: `url(${backgroundImagePath})` } : { backgroundColor: 'white' }
|
||||
return (
|
||||
<section
|
||||
className={`${style.section} ${customClass}`}
|
||||
style={isImagePath}
|
||||
>
|
||||
<div className="container">
|
||||
<div className={`${style['bloc-content']}`}>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
</section >
|
||||
);
|
||||
};
|
||||
|
||||
export default Section;
|
||||
Reference in new issue
Block a user