diff --git a/desafio-react-e-typescript/src/App.scss b/desafio-react-e-typescript/src/App.scss index a534de6..d283bb8 100644 --- a/desafio-react-e-typescript/src/App.scss +++ b/desafio-react-e-typescript/src/App.scss @@ -1,3 +1,7 @@ +body { + margin: 0; +} + .Container-menu { display: flex; diff --git a/desafio-react-e-typescript/src/App.tsx b/desafio-react-e-typescript/src/App.tsx index 97fc3d3..bb6917f 100644 --- a/desafio-react-e-typescript/src/App.tsx +++ b/desafio-react-e-typescript/src/App.tsx @@ -1,12 +1,43 @@ +import React, { useState, useEffect } from "react"; + import { Router } from "./router"; import "./App.scss"; +import { HeaderDesktop } from "./components/HeaderDesktop"; + +export function ScreenSize() { + const [windowDimenion, detectHW] = useState({ + winWidth: window.innerWidth, + }); + + const detectSize = () => { + detectHW({ + winWidth: window.innerWidth, + }); + }; + + useEffect(() => { + window.addEventListener("resize", detectSize); + + return () => { + window.removeEventListener("resize", detectSize); + }; + }, [windowDimenion]); + + return window.innerWidth > 1024 ? :

Hello World !

; +} + export const App = () => { return ( - <> -
- -
- + ScreenSize(), + ( + <> + {window.innerWidth > 1024 ? :

Hello World !

} + +
+ +
+ + ) ); }; diff --git a/desafio-react-e-typescript/src/assets/imgs/pngs/Logo-M3Academy.png b/desafio-react-e-typescript/src/assets/imgs/pngs/Logo-M3Academy.png new file mode 100644 index 0000000..779015f Binary files /dev/null and b/desafio-react-e-typescript/src/assets/imgs/pngs/Logo-M3Academy.png differ diff --git a/desafio-react-e-typescript/src/assets/imgs/pngs/cart.png b/desafio-react-e-typescript/src/assets/imgs/pngs/cart.png new file mode 100644 index 0000000..a84a5da Binary files /dev/null and b/desafio-react-e-typescript/src/assets/imgs/pngs/cart.png differ diff --git a/desafio-react-e-typescript/src/assets/imgs/pngs/search 2.png b/desafio-react-e-typescript/src/assets/imgs/pngs/search 2.png new file mode 100644 index 0000000..7b8f948 Binary files /dev/null and b/desafio-react-e-typescript/src/assets/imgs/pngs/search 2.png differ diff --git a/desafio-react-e-typescript/src/components/ContactForm.tsx b/desafio-react-e-typescript/src/components/ContactForm.tsx index 44660e7..bae8233 100644 --- a/desafio-react-e-typescript/src/components/ContactForm.tsx +++ b/desafio-react-e-typescript/src/components/ContactForm.tsx @@ -1,4 +1,4 @@ -import { Formik, Form, Field, ErrorMessage, FormikHelpers } from "formik"; +import { Formik, Form, Field, ErrorMessage } from "formik"; import FormSchema from "../schema/FormSchema"; interface IFormikValues { @@ -35,43 +35,55 @@ export const ContactForm = () => { {({ errors, touched }) => (

Preencha o formulário

+ + + + + + - +
diff --git a/desafio-react-e-typescript/src/components/HeaderDesktop.modules.scss b/desafio-react-e-typescript/src/components/HeaderDesktop.modules.scss new file mode 100644 index 0000000..270c24d --- /dev/null +++ b/desafio-react-e-typescript/src/components/HeaderDesktop.modules.scss @@ -0,0 +1,24 @@ +.Header { + display: flex; + justify-content: space-between; + padding: 0 100px; + background: #000000; + + .Search_Header_wrapper { + width: 100%; + .Search_Header { + width: 100%; + } + } + + @media (min-width: 1025px) { + padding: 22px 100px; + + .Search_Header_wrapper { + width: 100%; + .Search_Header { + width: 100%; + } + } + } +} diff --git a/desafio-react-e-typescript/src/components/HeaderDesktop.tsx b/desafio-react-e-typescript/src/components/HeaderDesktop.tsx new file mode 100644 index 0000000..5abc9af --- /dev/null +++ b/desafio-react-e-typescript/src/components/HeaderDesktop.tsx @@ -0,0 +1,28 @@ +import { NavLink } from "react-router-dom"; +import LogoM3 from "../assets/imgs/pngs/Logo-M3Academy.png"; +import CartIcon from "../assets/imgs/pngs/cart.png"; + +import "./HeaderDesktop.modules.scss"; + +export const HeaderDesktop = () => { + return ( + <> +
+
+ + LogoM3 + +
+
+ +
+
+ ENTRAR + + CartIcon + +
+
+ + ); +}; diff --git a/desafio-react-e-typescript/src/components/Navegation.scss b/desafio-react-e-typescript/src/components/Navegation.modules.scss similarity index 93% rename from desafio-react-e-typescript/src/components/Navegation.scss rename to desafio-react-e-typescript/src/components/Navegation.modules.scss index 8085164..62549f2 100644 --- a/desafio-react-e-typescript/src/components/Navegation.scss +++ b/desafio-react-e-typescript/src/components/Navegation.modules.scss @@ -1,4 +1,4 @@ -.Menu-routes { +.MenuRoutes { padding: 0 16px; @media (min-width: 1025px) { diff --git a/desafio-react-e-typescript/src/components/Navegation.tsx b/desafio-react-e-typescript/src/components/Navegation.tsx index 5888a19..b84be17 100644 --- a/desafio-react-e-typescript/src/components/Navegation.tsx +++ b/desafio-react-e-typescript/src/components/Navegation.tsx @@ -1,28 +1,28 @@ -import { Link } from "react-router-dom"; -import "./Navegation.scss"; +import { NavLink } from "react-router-dom"; +import "./Navegation.modules.scss"; export const Navegation = () => { return ( <> -