diff --git a/.lighthouserc.json b/.lighthouserc.json index c869c63..5cdcf70 100644 --- a/.lighthouserc.json +++ b/.lighthouserc.json @@ -4,7 +4,7 @@ "startServerCommand": "npm run start", "startServerReadyPattern": "ready on", "startServerReadyTimeout": 20000, - "url": ["http://localhost:3000/", "http://localhost:3000/setup"], + "url": ["http://localhost:3000/"], "numberOfRuns": 3 }, "assert": { diff --git a/components/Contact/index.tsx b/components/Contact/index.tsx index d5d1e08..0de6746 100644 --- a/components/Contact/index.tsx +++ b/components/Contact/index.tsx @@ -77,7 +77,7 @@ export const Contact: React.FC = () => { required /> -
+
diff --git a/components/Footer/LanguageButton.tsx b/components/Footer/LanguageButton.tsx deleted file mode 100644 index b8dfbc9..0000000 --- a/components/Footer/LanguageButton.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import setLanguage from 'next-translate/setLanguage' - -interface LanguageButtonProps { - lang: string -} - -export const LanguageButton: React.FC = (props) => { - return ( - <> - await setLanguage(props.lang)} - className='important' - > - {props.children} - - - - - ) -} diff --git a/components/Footer/LanguageFlag.tsx b/components/Footer/LanguageFlag.tsx deleted file mode 100644 index 2c23a55..0000000 --- a/components/Footer/LanguageFlag.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import Image from 'next/image' - -import { Tooltip } from 'components/design/Tooltip' -import { LanguageButton } from './LanguageButton' - -interface LanguageFlagProps { - imageLink: string - title: string - lang: string -} - -export const LanguageFlag: React.FC = (props) => { - const { lang, title, imageLink } = props - - return ( - <> -
- - - {title} - - -
- - - - ) -} diff --git a/components/Footer/index.tsx b/components/Footer/index.tsx index c637f4a..a4185a7 100644 --- a/components/Footer/index.tsx +++ b/components/Footer/index.tsx @@ -1,36 +1,16 @@ import useTranslation from 'next-translate/useTranslation' -import { LanguageButton } from './LanguageButton' -import { LanguageFlag } from './LanguageFlag' - export const Footer: React.FC = () => { const { t } = useTranslation() return ( <>
-

+

Divlo | {t('common:allRightsReserved')}

-

- {t('common:english')} |{' '} - {t('common:french')} -

-
- - -
- diff --git a/components/Header/BrandLogo.tsx b/components/Header/BrandLogo.tsx deleted file mode 100644 index 34bf215..0000000 --- a/components/Header/BrandLogo.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import Link from 'next/link' -import Image from 'next/image' - -export const BrandLogo: React.FC = () => { - return ( - <> - - - Divlo's Logo - - - - - - ) -} diff --git a/components/Header/HamburgerIcon.tsx b/components/Header/HamburgerIcon.tsx deleted file mode 100644 index c9c7c91..0000000 --- a/components/Header/HamburgerIcon.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import classNames from 'classnames' - -type HamburgerIconComponent = React.FC<{ - isActive: boolean - handleToggleNavbar: () => void -}> - -export const HamburgerIcon: HamburgerIconComponent = props => { - return ( - <> -
- -
- - - - ) -} diff --git a/components/Header/Language/Arrow.tsx b/components/Header/Language/Arrow.tsx new file mode 100644 index 0000000..0e2f6cf --- /dev/null +++ b/components/Header/Language/Arrow.tsx @@ -0,0 +1,16 @@ +export const Arrow: React.FC = () => { + return ( + + + + ) +} diff --git a/components/Header/Language/LanguageFlag.tsx b/components/Header/Language/LanguageFlag.tsx new file mode 100644 index 0000000..bf4efd7 --- /dev/null +++ b/components/Header/Language/LanguageFlag.tsx @@ -0,0 +1,31 @@ +import Image from 'next/image' + +export interface LanguageFlagProps { + language: string +} + +export const LanguageFlag: React.FC = (props) => { + const { language } = props + + return ( + <> + {language} +

{language.toUpperCase()}

+ + + + ) +} diff --git a/components/Header/Language/index.tsx b/components/Header/Language/index.tsx new file mode 100644 index 0000000..76b591d --- /dev/null +++ b/components/Header/Language/index.tsx @@ -0,0 +1,105 @@ +import { useEffect, useState } from 'react' +import useTranslation from 'next-translate/useTranslation' +import setLanguage from 'next-translate/setLanguage' + +import { Arrow } from './Arrow' +import { LanguageFlag } from './LanguageFlag' +import { locales } from 'i18n.json' + +export const Language: React.FC = () => { + const { lang: currentLanguage } = useTranslation() + const [hiddenMenu, setHiddenMenu] = useState(true) + + useEffect(() => { + if (!hiddenMenu) { + window.document.addEventListener('click', handleHiddenMenu) + } else { + window.document.removeEventListener('click', handleHiddenMenu) + } + + return () => { + window.document.removeEventListener('click', handleHiddenMenu) + } + }, [hiddenMenu]) + + const handleLanguage = async (language: string): Promise => { + await setLanguage(language) + handleHiddenMenu() + } + + const handleHiddenMenu = (): void => { + setHiddenMenu(!hiddenMenu) + } + + return ( + <> +
+
+ + +
+ {!hiddenMenu && ( +
    + {locales.map((language, index) => { + if (language === currentLanguage) { + return null + } + return ( +
  • await handleLanguage(language)} + > + +
  • + ) + })} +
+ )} +
+ + + + ) +} diff --git a/components/Header/Navigation/NavigationLink.tsx b/components/Header/Navigation/NavigationLink.tsx deleted file mode 100644 index ad97b5b..0000000 --- a/components/Header/Navigation/NavigationLink.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import Link from 'next/link' -import { useRouter } from 'next/router' -import classNames from 'classnames' - -type NavigationLinkComponent = React.FC<{ path: string }> - -export const NavigationLink: NavigationLinkComponent = props => { - const { pathname } = useRouter() - const isCurrentPage = pathname === props.path - - return ( - <> -
  • - - - {props.children} - - -
  • - - - - ) -} diff --git a/components/Header/Navigation/index.tsx b/components/Header/Navigation/index.tsx deleted file mode 100644 index b0c20f9..0000000 --- a/components/Header/Navigation/index.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import classNames from 'classnames' -import useTranslation from 'next-translate/useTranslation' - -import { NavigationLink } from './NavigationLink' - -type NavigationComponent = React.FC<{ isActive: boolean }> - -export const Navigation: NavigationComponent = props => { - const { t } = useTranslation() - - return ( - <> - - - - - ) -} diff --git a/components/Header/index.tsx b/components/Header/index.tsx index a4a6b3f..612d381 100644 --- a/components/Header/index.tsx +++ b/components/Header/index.tsx @@ -1,65 +1,84 @@ -import { useState } from 'react' +import Link from 'next/link' +import Image from 'next/image' -import { HamburgerIcon } from './HamburgerIcon' -import { BrandLogo } from './BrandLogo' -import { Navigation } from './Navigation' +import { Language } from './Language' export const Header: React.FC = () => { - const [isActive, setIsActive] = useState(false) - - const handleToggleNavbar = (): void => { - setIsActive(!isActive) - } - return ( <> -
    +
    - - - +
    - - ) -} diff --git a/components/Setup/TableTitle.tsx b/components/Setup/TableTitle.tsx deleted file mode 100644 index de06c37..0000000 --- a/components/Setup/TableTitle.tsx +++ /dev/null @@ -1,21 +0,0 @@ -export const TableTitle: React.FC = props => { - const { children } = props - - return ( - <> -
    -

    - {children} -

    -
    - - - - ) -} diff --git a/components/Setup/index.tsx b/components/Setup/index.tsx deleted file mode 100644 index 03c9ecb..0000000 --- a/components/Setup/index.tsx +++ /dev/null @@ -1,137 +0,0 @@ -import useTranslation from 'next-translate/useTranslation' -import Image from 'next/image' - -import { Table, TableRow } from './Table' -import { TableTitle } from './TableTitle' - -export const Setup: React.FC = () => { - const { t } = useTranslation() - - const rowsConfigPC: TableRow[] = [ - { - title: t('setup:configPC.motherboard'), - value: 'MSI Z87-G45 GAMING' - }, - { - title: t('setup:configPC.processor'), - value: 'Intel Core i5-4690k' - }, - { - title: t('setup:configPC.graphicCard'), - value: 'Zotac GeForce GTX 970' - }, - { - title: t('setup:configPC.ramMemory'), - value: '16 GB (2 x 8Go) Kingston HyperX' - }, - { - title: t('setup:configPC.hardDrive'), - value: '256 GB SSD Crucial & 2 TB Seagate' - } - ] - - const rowsPeripherals: TableRow[] = [ - { - title: t('setup:peripheral.keyboard'), - value: 'Corsair K95 RGB' - }, - { - title: t('setup:peripheral.mouse'), - value: 'SteelSeries Rival 310' - }, - { - title: t('setup:peripheral.headset'), - value: 'SteelSeries ARCTIS PRO + GAMEDAC' - }, - { - title: t('setup:peripheral.mainScreen'), - value: 'IIyama PL2480H' - }, - { - title: t('setup:peripheral.secondScreen'), - value: 'Samsung SyncMaster 2220LM' - } - ] - - const rowsOffice: TableRow[] = [ - { - title: t('setup:officeOther.mousepad'), - value: 'SteelSeries QCK Heavy (Grand) as string' - }, - { - title: 'Mouse Bungee', - value: 'BenQ ZOWIE Camade' - }, - { - title: t('setup:officeOther.usb'), - value: 'Kingston 128GB' - }, - { - title: 'Smartphone', - value: 'Samsung Galaxy A5 (2017)' - } - ] - - return ( - <> - {t('setup:configPC.title')} - - - {t('setup:peripheral.title')} -
    - - {t('setup:officeOther.title')} -
    - -
    - -
    - -
    - -
    - -
    - {t('setup:connexion')} -
    - - - -
    -
    - - - - ) -} diff --git a/i18n.json b/i18n.json index a01f2a6..9f5b4df 100644 --- a/i18n.json +++ b/i18n.json @@ -4,7 +4,6 @@ "pages": { "*": ["common"], "/": ["home"], - "/setup": ["setup"], "/404": ["errors"], "/500": ["errors"] } diff --git a/locales/en/home.json b/locales/en/home.json index 3080199..e387f80 100644 --- a/locales/en/home.json +++ b/locales/en/home.json @@ -19,7 +19,7 @@ }, { "title": "Open-Source enthusiast :", - "description": "For me, everyone should work, solve problems, build things and think together. Long live open source, whenever you can share your work, do it!
    The website is open-source on github." + "description": "For me, everyone should work, solve problems, build things and think together. Long live open source, whenever you can share your work, do it!
    The website is open-source on github." } ] }, diff --git a/locales/en/setup.json b/locales/en/setup.json deleted file mode 100644 index 9fc4bb9..0000000 --- a/locales/en/setup.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "title": "Setup of Divlo", - "description": "The list of all the computer equipment that Divlo has.", - "configPC": { - "title": "Hardware PC Configuration", - "motherboard": "Motherboard", - "processor": "Processor", - "graphicCard": "Graphic card", - "ramMemory": "Ram Memory", - "hardDrive": "Hard Drive" - }, - "peripheral": { - "title": "Computer Peripheral ", - "keyboard": "Keyboard", - "mouse": "Mouse", - "headset": "Micro Headset", - "mainScreen": "Main Screen", - "secondScreen": "2nd screen" - }, - "officeOther": { - "title": "Office / Other", - "mousepad": "Mousepad", - "usb": "USB Key" - }, - "connexion": "My internet connection" -} diff --git a/locales/fr/home.json b/locales/fr/home.json index b27c55c..e0c6878 100644 --- a/locales/fr/home.json +++ b/locales/fr/home.json @@ -4,7 +4,7 @@ "description": "Développeur Full Stack Junior • Passionné de High-Tech", "birthDate": "Date de naissance", "nationality": "Nationalité", - "descriptionBottom": "J'apprends en ligne l'informatique et les langages de programmation pour m'améliorer dans ma passion.

    J'ai conçu ma charte graphique et mon site internet." + "descriptionBottom": "J'apprends en ligne l'informatique et les langages de programmation pour m'améliorer dans ma passion. <0/> <0/> J'ai conçu ma charte graphique et mon site internet." }, "interests": { "title": "Mes intérêts", @@ -19,7 +19,7 @@ }, { "title": "Enthousiaste de l'Open-Source :", - "description": "Pour moi, tout le monde devrait travailler, résoudre des problèmes, construire des choses et réfléchir ensemble. Longue vie à l'open-source, chaque fois que vous pouvez partagez votre travail, faites-le!
    Le site est open-source sur github." + "description": "Pour moi, tout le monde devrait travailler, résoudre des problèmes, construire des choses et réfléchir ensemble. Longue vie à l'open-source, chaque fois que vous pouvez partagez votre travail, faites-le!
    Le site est open-source sur github." } ] }, diff --git a/locales/fr/setup.json b/locales/fr/setup.json deleted file mode 100644 index 7797a43..0000000 --- a/locales/fr/setup.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "title": "Setup de Divlo", - "description": "La liste de tout le matériel informatique dont dispose Divlo.", - "configPC": { - "title": "Configuration matérielle du PC", - "motherboard": "Carte mère", - "processor": "Processeur", - "graphicCard": "Carte graphique", - "ramMemory": "Mémoires Ram", - "hardDrive": "Disques Dur" - }, - "peripheral": { - "title": "Périphériques", - "keyboard": "Clavier", - "mouse": "Souris", - "headset": "Casque Micro", - "mainScreen": "Écran Principal", - "secondScreen": "2ème écran" - }, - "officeOther": { - "title": "Bureautique / Autre", - "mousepad": "Tapis de souris", - "usb": "Clé USB" - }, - "connexion": "Ma connection internet" -} diff --git a/package-lock.json b/package-lock.json index 141485d..d77aa00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "classnames": "2.3.1", "html-react-parser": "1.2.5", "next": "10.1.3", - "next-pwa": "5.2.10", + "next-pwa": "5.2.12", "next-translate": "1.0.6", "nodemailer": "6.5.0", "normalize.css": "8.0.1", @@ -9802,9 +9802,9 @@ } }, "node_modules/next-pwa": { - "version": "5.2.10", - "resolved": "https://registry.npmjs.org/next-pwa/-/next-pwa-5.2.10.tgz", - "integrity": "sha512-0WIEIEqAy9q5YGA/gYwXVWHStGtoIqJRAZusO3PlRHo3HDr5CWs1RCJ/2faCL/UIyZ9msrUxl0+GR9oxlest0A==", + "version": "5.2.12", + "resolved": "https://registry.npmjs.org/next-pwa/-/next-pwa-5.2.12.tgz", + "integrity": "sha512-MWVpV5sq0eQnJnp79o0DQlMOIpmEoBLpeakKqrAXlhyLLKRF+94UmeLaBLtWvj2yadBGfpa59EbiTTGv+cfySw==", "dependencies": { "babel-loader": "^8.2.2", "clean-webpack-plugin": "^3.0.0", @@ -10623,9 +10623,9 @@ } }, "node_modules/object-inspect": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.1.tgz", - "integrity": "sha512-WQUIkCSDPWm5ing/PTUkLr2KaOXX2uV/vz1hLGW2XbZ/RDUmtgcsOyEqA1ox0rkyNx9mJX4kxX+YWceje3pmag==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz", + "integrity": "sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -22853,9 +22853,9 @@ } }, "next-pwa": { - "version": "5.2.10", - "resolved": "https://registry.npmjs.org/next-pwa/-/next-pwa-5.2.10.tgz", - "integrity": "sha512-0WIEIEqAy9q5YGA/gYwXVWHStGtoIqJRAZusO3PlRHo3HDr5CWs1RCJ/2faCL/UIyZ9msrUxl0+GR9oxlest0A==", + "version": "5.2.12", + "resolved": "https://registry.npmjs.org/next-pwa/-/next-pwa-5.2.12.tgz", + "integrity": "sha512-MWVpV5sq0eQnJnp79o0DQlMOIpmEoBLpeakKqrAXlhyLLKRF+94UmeLaBLtWvj2yadBGfpa59EbiTTGv+cfySw==", "requires": { "babel-loader": "^8.2.2", "clean-webpack-plugin": "^3.0.0", @@ -23421,9 +23421,9 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, "object-inspect": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.1.tgz", - "integrity": "sha512-WQUIkCSDPWm5ing/PTUkLr2KaOXX2uV/vz1hLGW2XbZ/RDUmtgcsOyEqA1ox0rkyNx9mJX4kxX+YWceje3pmag==" + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz", + "integrity": "sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA==" }, "object-is": { "version": "1.1.5", diff --git a/package.json b/package.json index ab358db..f0646d1 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "classnames": "2.3.1", "html-react-parser": "1.2.5", "next": "10.1.3", - "next-pwa": "5.2.10", + "next-pwa": "5.2.12", "next-translate": "1.0.6", "nodemailer": "6.5.0", "normalize.css": "8.0.1", diff --git a/pages/api/send-email.ts b/pages/api/send-email.ts index 2324b37..5357d68 100644 --- a/pages/api/send-email.ts +++ b/pages/api/send-email.ts @@ -18,14 +18,14 @@ const emailTransporter = nodemailer.createTransport({ }) export default async ( - req: NextApiRequest, - res: NextApiResponse + request: NextApiRequest, + response: NextApiResponse ): Promise => { - if (req.method !== 'POST') { - return res.redirect('/404') + if (request.method !== 'POST') { + return response.redirect('/404') } - let { name, email, subject, message } = req.body as { + let { name, email, subject, message } = request.body as { name: string email: string subject: string @@ -38,11 +38,11 @@ export default async ( validator.isEmpty(subject) || validator.isEmpty(message) ) { - return res.status(400).json({ type: 'requiredFields' }) + return response.status(400).json({ type: 'requiredFields' }) } if (!validator.isEmail(email)) { - return res.status(400).json({ type: 'invalidEmail' }) + return response.status(400).json({ type: 'invalidEmail' }) } email = validator.normalizeEmail(email) as string @@ -62,8 +62,8 @@ export default async ( Message: ${message} ` }) - return res.status(201).json({ type: 'success' }) + return response.status(201).json({ type: 'success' }) } catch { - return res.status(500).json({ type: 'serverError' }) + return response.status(500).json({ type: 'serverError' }) } } diff --git a/pages/setup.tsx b/pages/setup.tsx deleted file mode 100644 index 5313060..0000000 --- a/pages/setup.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { GetStaticProps } from 'next' -import useTranslation from 'next-translate/useTranslation' - -import { Section } from 'components/design/Section' -import Head from 'components/Head' -import { Setup } from 'components/Setup' - -const SetupPage: React.FC = () => { - const { t } = useTranslation() - - return ( - <> - - -
    - -
    - - ) -} - -export const getStaticProps: GetStaticProps = async () => { - return { props: {} } -} - -export default SetupPage diff --git a/public/images/flags/english_flag.png b/public/images/flags/english_flag.png deleted file mode 100644 index 578908a..0000000 Binary files a/public/images/flags/english_flag.png and /dev/null differ diff --git a/public/images/flags/french_flag.png b/public/images/flags/french_flag.png deleted file mode 100644 index 3bd9029..0000000 Binary files a/public/images/flags/french_flag.png and /dev/null differ diff --git a/public/images/languages/en.svg b/public/images/languages/en.svg new file mode 100644 index 0000000..c8ac578 --- /dev/null +++ b/public/images/languages/en.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/languages/fr.svg b/public/images/languages/fr.svg new file mode 100644 index 0000000..bc83f50 --- /dev/null +++ b/public/images/languages/fr.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/public/images/setup/setup2019-lights.jpg b/public/images/setup/setup2019-lights.jpg deleted file mode 100644 index dc4385c..0000000 Binary files a/public/images/setup/setup2019-lights.jpg and /dev/null differ diff --git a/public/images/setup/setup2019.png b/public/images/setup/setup2019.png deleted file mode 100644 index aabc000..0000000 Binary files a/public/images/setup/setup2019.png and /dev/null differ diff --git a/public/images/setup/speedtest-result.png b/public/images/setup/speedtest-result.png deleted file mode 100644 index 44c78af..0000000 Binary files a/public/images/setup/speedtest-result.png and /dev/null differ diff --git a/styles/general.scss b/styles/general.scss index a552a88..da78d3d 100644 --- a/styles/general.scss +++ b/styles/general.scss @@ -4,7 +4,8 @@ --color-text-1: rgb(222, 222, 222); --color-text-2: #b2bac2; --color-background: #181818; - --header-height: 99px; + --color-shadow: rgba(255, 255, 255, 0.2); + --header-height: 79px; } *, *::before,