From 51104d244e342e3fc21df5b8b78caa4fcf6e147d Mon Sep 17 00:00:00 2001 From: Rhayllon Date: Fri, 20 Jan 2023 18:43:27 -0300 Subject: [PATCH] Feat(Main): Cria rotas da pagina, e cria main page completa com responsividade mobile e Tv --- desafio/package-lock.json | 17 + desafio/package.json | 1 + desafio/src/assets/imgs/whatsapp.png | Bin 0 -> 1042 bytes desafio/src/assets/svgs/ArrowToTop.svg | 3 + desafio/src/assets/svgs/arrowBreadcrumb.svg | 10 + desafio/src/assets/svgs/homeBreadcrumb.svg | 10 + desafio/src/components/Footer.tsx | 2 +- desafio/src/components/Header.tsx | 242 ++++++++--- .../src/components/InstitucionalContent.tsx | 13 + desafio/src/components/MainPage.tsx | 411 ++++++++++++++++++ desafio/src/components/MaskedInput.tsx | 14 + desafio/src/components/ModalMenu.tsx | 50 ++- desafio/src/components/WhatappButtontop.tsx | 29 ++ desafio/src/index.tsx | 43 +- desafio/src/pages/Cursos.tsx | 4 + desafio/src/pages/Home.tsx | 4 + desafio/src/pages/Institucionais.tsx | 13 - desafio/src/pages/Institucional.tsx | 18 + desafio/src/pages/Saibamais.tsx | 4 + desafio/src/schema/FormSchema.ts | 11 + desafio/src/scss/global.scss | 81 +--- desafio/src/scss/partials/ModalMenu.scss | 154 ++++--- .../src/scss/partials/WhattsButtonTop.scss | 28 ++ desafio/src/scss/partials/header.module.scss | 5 +- desafio/src/scss/partials/home.scss | 0 .../src/scss/partials/mainPage.module.scss | 338 ++++++++++++++ desafio/src/scss/utils/variables.scss | 6 + 27 files changed, 1232 insertions(+), 279 deletions(-) create mode 100644 desafio/src/assets/imgs/whatsapp.png create mode 100644 desafio/src/assets/svgs/ArrowToTop.svg create mode 100644 desafio/src/assets/svgs/arrowBreadcrumb.svg create mode 100644 desafio/src/assets/svgs/homeBreadcrumb.svg create mode 100644 desafio/src/components/InstitucionalContent.tsx create mode 100644 desafio/src/components/MainPage.tsx create mode 100644 desafio/src/components/MaskedInput.tsx create mode 100644 desafio/src/components/WhatappButtontop.tsx delete mode 100644 desafio/src/pages/Institucionais.tsx create mode 100644 desafio/src/pages/Institucional.tsx create mode 100644 desafio/src/schema/FormSchema.ts create mode 100644 desafio/src/scss/partials/WhattsButtonTop.scss delete mode 100644 desafio/src/scss/partials/home.scss create mode 100644 desafio/src/scss/partials/mainPage.module.scss diff --git a/desafio/package-lock.json b/desafio/package-lock.json index e76779e..9c19bfb 100644 --- a/desafio/package-lock.json +++ b/desafio/package-lock.json @@ -15,6 +15,7 @@ "@types/node": "^16.18.11", "@types/react": "^18.0.26", "@types/react-dom": "^18.0.10", + "@types/react-input-mask": "^3.0.2", "formik": "^2.2.9", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -3881,6 +3882,14 @@ "@types/react": "*" } }, + "node_modules/@types/react-input-mask": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/react-input-mask/-/react-input-mask-3.0.2.tgz", + "integrity": "sha512-WTli3kUyvUqqaOLYG/so2pLqUvRb+n4qnx2He5klfqZDiQmRyD07jVIt/bco/1BrcErkPMtpOm+bHii4Oed6cQ==", + "dependencies": { + "@types/react": "*" + } + }, "node_modules/@types/react-modal": { "version": "3.13.1", "resolved": "https://registry.npmjs.org/@types/react-modal/-/react-modal-3.13.1.tgz", @@ -19663,6 +19672,14 @@ "@types/react": "*" } }, + "@types/react-input-mask": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/react-input-mask/-/react-input-mask-3.0.2.tgz", + "integrity": "sha512-WTli3kUyvUqqaOLYG/so2pLqUvRb+n4qnx2He5klfqZDiQmRyD07jVIt/bco/1BrcErkPMtpOm+bHii4Oed6cQ==", + "requires": { + "@types/react": "*" + } + }, "@types/react-modal": { "version": "3.13.1", "resolved": "https://registry.npmjs.org/@types/react-modal/-/react-modal-3.13.1.tgz", diff --git a/desafio/package.json b/desafio/package.json index 6ed91ad..b23da3c 100644 --- a/desafio/package.json +++ b/desafio/package.json @@ -10,6 +10,7 @@ "@types/node": "^16.18.11", "@types/react": "^18.0.26", "@types/react-dom": "^18.0.10", + "@types/react-input-mask": "^3.0.2", "formik": "^2.2.9", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/desafio/src/assets/imgs/whatsapp.png b/desafio/src/assets/imgs/whatsapp.png new file mode 100644 index 0000000000000000000000000000000000000000..567e0bea8fe7c188df7b6e18505027ca90e21a94 GIT binary patch literal 1042 zcmV+t1nv8YP)&Y6K^kcMd9#7xkE32M;1oYjSp(=Dh}h*i*KwC>6Z^{TE)?XtghWj`02Y2Zyd z!3*g^1r3%^8&X6jI6=K=y7j(iJ7Z@%JKNDSA2^(y_j~t!&w2kh0XpFDI!dD=T(Kw` zqd=nwm}5XGuL(eyWFfkTL=iqQifNzI7s_{UAs?l7ufs;SKDuns2OoAYG=9nF&!wnI zge+j*0bcKcK>8sb6EL7F{ug375#L3L{~A4 zLor#Vt@g4-SbiVyBNvebi9Qqx0&Hqz6fwf?ATvJ20f5fA^U3KO%pk&n$uS|PV=77x zm7wx)1vVpFSlwQQK?oNCO>zJi$x~u}Gg1h-vk_5wAWrcyTwSSOmRGbL;=eC-by`~)%L?#vIPn=Z{+c%2hi6L@q zkTo1?Iwy}-XULdD2N5(7HXF4LaaW^YRi;@(MvJlT!4bg4uIbFCz*(Y(9~(g!34t3Z zxy77KVfOcz4A~z_-xrIoU?ikYE@%*$T$#*}Jzso@tt^(>E0}|*Ry$?i~($_1{Y0A$!TVJ!uA!{FRAh3sa-4Vq%B;!KV=>2KXhR;DTb-BQHnrk1G1)rY%3bwW z6_zV2E|b=o)aR8ciBvl1{Ko=M=F|n(p#$CI%^otnUfiS3y`<8)>HKPu<^c{?KXhOu z@RkC2Sodra+z6?OeG@d3$mu%(onSNf&OD_1WM2AQkJJjG5EG;+EjgjlOfrQ%PV5{v z)~Yj7v8zyNluSacEl{?2Xk5ImAks$Tz@aRoq8?OJAUBlPOWDL0V9RA`31NzjrisL; zm_9rQwVI&8aF08EL-Iqi#3#l@GY$s*sU#Fc$TTh-446bla-=pr8wv|96K*vUNg^t4 z3Dff+rIv#u8~cZ!12f$nsgQoxuv-%UZFuN#|JX(Ebc)WX{iD-^-IzPukgY|4_UljE zPZd(u@D%NjS6EGOiqju3Hj{|Xga!GM)1AN1FS9^v3!A{3eD;*_AMT`6H+$W~qyPW_ M07*qoM6N<$g4V0fwg3PC literal 0 HcmV?d00001 diff --git a/desafio/src/assets/svgs/ArrowToTop.svg b/desafio/src/assets/svgs/ArrowToTop.svg new file mode 100644 index 0000000..a217195 --- /dev/null +++ b/desafio/src/assets/svgs/ArrowToTop.svg @@ -0,0 +1,3 @@ + + + diff --git a/desafio/src/assets/svgs/arrowBreadcrumb.svg b/desafio/src/assets/svgs/arrowBreadcrumb.svg new file mode 100644 index 0000000..a8a0fcc --- /dev/null +++ b/desafio/src/assets/svgs/arrowBreadcrumb.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/desafio/src/assets/svgs/homeBreadcrumb.svg b/desafio/src/assets/svgs/homeBreadcrumb.svg new file mode 100644 index 0000000..898d772 --- /dev/null +++ b/desafio/src/assets/svgs/homeBreadcrumb.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/desafio/src/components/Footer.tsx b/desafio/src/components/Footer.tsx index 077044c..88e2a6d 100644 --- a/desafio/src/components/Footer.tsx +++ b/desafio/src/components/Footer.tsx @@ -103,7 +103,7 @@ const FooterMidle = () => {
-

Institucional

+

Fale Conosco

    diff --git a/desafio/src/components/Header.tsx b/desafio/src/components/Header.tsx index b4d591d..d066595 100644 --- a/desafio/src/components/Header.tsx +++ b/desafio/src/components/Header.tsx @@ -1,85 +1,189 @@ import React from "react"; import { ModalMenu } from "./ModalMenu"; -import styles from "../scss/partials/header.module.scss" +import styles from "../scss/partials/header.module.scss"; +import { Link } from "react-router-dom"; -import logo from "../assets/imgs/Image-LogoM3Academy.png" -import iconLupa from "../assets/svgs/Vector-Search.svg" -import iconCart from "../assets/svgs/Cart-Icon.svg" -import menuMobile from "../assets/svgs/MenuMobile.svg" +import logo from "../assets/imgs/Image-LogoM3Academy.png"; +import iconLupa from "../assets/svgs/Vector-Search.svg"; +import iconCart from "../assets/svgs/Cart-Icon.svg"; const Header = () => { - return
    - + return ( +
    +
    -} + ); +}; -const HeaderPlatforms : any = () => { - if (window.innerWidth > 1024){ - return <> - - - - }else if (window.innerWidth <= 1024){ - return <> - - - } -} +const HeaderPlatforms: any = () => { + if (window.innerWidth > 1024) { + return ( + <> + + + + ); + } else if (window.innerWidth <= 1024) { + return ( + <> + + + ); + } +}; const HeaderTop = () => { - return ( -
    - LogoM3 -
    - - - -
    -
    - Entrar - Icone Carrinho -
    -
    - ) + return ( +
    + + LogoM3 + +
    + + +
    + +
    + ); }; const HeaderTopMobile = () => { - return ( -
    - -
    - LogoM3 -
    -
    - Entrar - Icone Carrinho -
    -
    - - -
    -
    - - ) + return ( +
    + +
    + + LogoM3 + +
    + +
    + + +
    +
    + ); }; const HeaderBottom = () => { - return ( - - ) + return ( +
    + +
    + ); }; -export { Header }; \ No newline at end of file +export { Header }; diff --git a/desafio/src/components/InstitucionalContent.tsx b/desafio/src/components/InstitucionalContent.tsx new file mode 100644 index 0000000..d71ba4b --- /dev/null +++ b/desafio/src/components/InstitucionalContent.tsx @@ -0,0 +1,13 @@ +import React from "react"; + + +// const DivContent = () => { +// return ( +//
    +//

    Sobre

    +//

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt

    +//
    +// ) +// }; + +export {} \ No newline at end of file diff --git a/desafio/src/components/MainPage.tsx b/desafio/src/components/MainPage.tsx new file mode 100644 index 0000000..c72fa14 --- /dev/null +++ b/desafio/src/components/MainPage.tsx @@ -0,0 +1,411 @@ +import React, { useState } from "react"; + +import { NavLink, Outlet } from "react-router-dom"; +import { Formik, Form, Field, ErrorMessage, FormikHelpers } from "formik"; +import FormSchema from "../schema/FormSchema"; + +import styles from "../scss/partials/mainPage.module.scss"; +import homeBreadcrumb from "../assets/svgs/homeBreadcrumb.svg"; +import arrowBreadcrumb from "../assets/svgs/arrowBreadcrumb.svg"; + +const MainPage = () => { + return ( +
    + +
    + + +
    +
    + ); +}; + +const DivLinks = () => { + return ( +
    + + isActive ? "active-link-intitucional" : "" + } + > + Sobre + + + isActive ? "active-link-intitucional" : "" + } + > + Forma de Pagamento + + + isActive ? "active-link-intitucional" : "" + } + > + Entrega + + + isActive ? "active-link-intitucional" : "" + } + > + Troca e Devolução + + + isActive ? "active-link-intitucional" : "" + } + > + Segurança e Privacidade + + + isActive ? "active-link-intitucional" : "" + } + > + Contato + +
    + ); +}; + +interface IContent { + contentTitle: string; + content: string; +} + +const DivContent = (props: IContent) => { + const { content, contentTitle } = props; + return ( +
    +

    + {contentTitle} +

    +

    + {content} +

    +
    + ); +}; + +interface IFormikValues { + name: string; + email: string; + cpf: string; + dataNascimento: string; + telefone: string; + instagram: string; + terms: boolean; +} + +const DivContentForm = () => { + const initialValues = { + name: "", + email: "", + cpf: "", + dataNascimento: "", + telefone: "", + instagram: "", + terms: false, + }; + + const handleFormikSubmit = (values: IFormikValues) => {}; + return ( +
    + +
    +

    + Preencha o formulário{" "} +

    +
    + + + +
    +
    + + + +
    +
    + + + +
    +
    + + + +
    +
    + + + +
    +
    + + + {/* */} +
    +
    + + + +
    + + +
    +
    +
    + ); +}; + +const BreadcrumbAndTitle = () => { + return ( +
    +
      +
    • + Home Icon +
    • +
    • + Arrow Icon +
    • +
    • +

      + Institucional +

      +
    • +
    +

    + Institucional +

    +
    + ); +}; + +export { MainPage, DivContent, DivContentForm }; diff --git a/desafio/src/components/MaskedInput.tsx b/desafio/src/components/MaskedInput.tsx new file mode 100644 index 0000000..f536029 --- /dev/null +++ b/desafio/src/components/MaskedInput.tsx @@ -0,0 +1,14 @@ +import React from "react"; +import ReactInputMask from "react-input-mask"; + +interface IValues { + value: any, + onChange: any +} + +const MaskedInput = () => { + return +} + +export {MaskedInput} +// value={values.value} onChange={values.onChange} \ No newline at end of file diff --git a/desafio/src/components/ModalMenu.tsx b/desafio/src/components/ModalMenu.tsx index b031e0d..9c0b88c 100644 --- a/desafio/src/components/ModalMenu.tsx +++ b/desafio/src/components/ModalMenu.tsx @@ -1,26 +1,29 @@ -import React, {useState} from "react"; -import Modal from 'react-modal'; +import React, { useState } from "react"; +import Modal from "react-modal"; import { Link } from "react-router-dom"; -import menuMobile from "../assets/svgs/MenuMobile.svg" -import closeMenuMobile from "../assets/svgs/CloseMenuMobile.svg" +import menuMobile from "../assets/svgs/MenuMobile.svg"; +import closeMenuMobile from "../assets/svgs/CloseMenuMobile.svg"; +import "../scss/partials/modalMenu.scss"; -Modal.setAppElement('#root'); +Modal.setAppElement("#root"); const ModalMenu = () => { + const [modalIsOpen, setIsOpen] = React.useState(false); - const [modalIsOpen, setIsOpen] = React.useState(false); + function openModal() { + setIsOpen(true); + } - function openModal() { - setIsOpen(true); - } + function closeModal() { + setIsOpen(false); + } - function closeModal() { - setIsOpen(false); - } - - return
    - + return ( +
    + { className="modal-content" >
    - Cursos - Saiba Mais - Institucional + Cursos + Saiba Mais + Institucional
    - +
    -} + ); +}; -export { ModalMenu }; \ No newline at end of file +export { ModalMenu }; diff --git a/desafio/src/components/WhatappButtontop.tsx b/desafio/src/components/WhatappButtontop.tsx new file mode 100644 index 0000000..4d72e6a --- /dev/null +++ b/desafio/src/components/WhatappButtontop.tsx @@ -0,0 +1,29 @@ +import React from "react"; + +import whattsIcon from "../assets/imgs/whatsapp.png" +import arrowToTop from "../assets/svgs/ArrowToTop.svg" +import "../scss/partials/WhattsButtonTop.scss" + +// interface IWhatsButtonCss{ +// className: string; +// } + +const Whatts = () => { + // const {className} = props + + return
    + + Icone para redirecionar à conversa no Whatts + +
    +} +const ButtonToTop = () => { + + return +
    + Seta para cima +
    +
    +} + +export {Whatts, ButtonToTop} \ No newline at end of file diff --git a/desafio/src/index.tsx b/desafio/src/index.tsx index 1238a0a..8550186 100644 --- a/desafio/src/index.tsx +++ b/desafio/src/index.tsx @@ -1,25 +1,36 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import './scss/global.scss'; -import './scss/utils/variables.scss'; +import React from "react"; +import ReactDOM from "react-dom/client"; +import "./scss/global.scss"; +import "./scss/utils/variables.scss"; + +import { BrowserRouter, Routes, Route } from "react-router-dom"; +import { Home } from "./pages/Home"; +import { Cursos } from "./pages/Cursos"; +import { Saibamais } from "./pages/Saibamais"; +import { Institucional } from "./pages/Institucional"; +import { DivContent, DivContentForm } from "./components/MainPage"; + +const titletext = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.\nUt enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?" -import {BrowserRouter, Routes, Route} from "react-router-dom" -import {Home} from "./pages/Home" -import { Cursos } from './pages/Cursos'; -import { Saibamais } from './pages/Saibamais'; -import { Institucionais } from './pages/Institucionais'; const root = ReactDOM.createRoot( - document.getElementById('root') as HTMLElement + document.getElementById("root") as HTMLElement ); -root.render( +root.render( - }/> - }/> - }/> - }/> + } /> + } /> + } /> + } > + }/> + }/> + }/> + }/> + }/> + }/> + - ); +); diff --git a/desafio/src/pages/Cursos.tsx b/desafio/src/pages/Cursos.tsx index af4e319..7cb5756 100644 --- a/desafio/src/pages/Cursos.tsx +++ b/desafio/src/pages/Cursos.tsx @@ -2,11 +2,15 @@ import React from "react"; import { Header } from "../components/Header" import { Footer } from "../components/Footer" +import { MainPage } from "../components/MainPage"; +import { Whatts, ButtonToTop } from "../components/WhatappButtontop"; const Cursos = () => { return <>