Merge pull request 'feature/header' (#1) from feature/header into main

Reviewed-on: #1
This commit is contained in:
Naian Felix dos Santos 2023-01-10 18:51:47 +00:00
commit 14462eb0a7
19 changed files with 17416 additions and 0 deletions

23
desafio5/.gitignore vendored Normal file
View File

@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

46
desafio5/README.md Normal file
View File

@ -0,0 +1,46 @@
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).

16798
desafio5/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

43
desafio5/package.json Normal file
View File

@ -0,0 +1,43 @@
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.11",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"typescript": "^4.9.4",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Desafio 5</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

View File

@ -0,0 +1,5 @@
<svg width="28" height="23" viewBox="0 0 28 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M26.25 19.0001H1.75002C0.783509 19.0001 0 19.7836 0 20.7501C0 21.7166 0.783508 22.5001 1.75002 22.5001H26.25C27.2165 22.5001 28 21.7166 28 20.7501C28 19.7836 27.2165 19.0001 26.25 19.0001Z" fill="white"/>
<path d="M26.25 9.5H1.75002C0.783509 9.5 0 10.2835 0 11.25C0 12.2165 0.783508 13 1.75002 13H26.25C27.2165 13 28 12.2165 28 11.25C28 10.2835 27.2165 9.5 26.25 9.5Z" fill="white"/>
<path d="M26.25 0H1.75002C0.783509 0 0 0.783509 0 1.75002C0 2.71652 0.783508 3.50003 1.75002 3.50003H26.25C27.2165 3.50003 28 2.71652 28 1.75002C28 0.783509 27.2165 0 26.25 0Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 688 B

View File

@ -0,0 +1,12 @@
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_3927_38)">
<path d="M27.823 4.07236C27.6697 3.88079 27.4377 3.76928 27.1923 3.76928H5.69581L5.09469 1.16451C5.01009 0.798054 4.68377 0.538452 4.30768 0.538452H0.80768C0.361648 0.538452 0 0.9001 0 1.34619C0 1.79227 0.361648 2.15387 0.80768 2.15387H3.66516L7.7455 19.8355C7.83005 20.2019 8.15642 20.4615 8.53251 20.4615H24.7154C25.1614 20.4615 25.523 20.0999 25.523 19.6539C25.523 19.2078 25.1614 18.8462 24.7154 18.8462H9.17509L8.55384 16.1539H24.7693C25.1471 16.1539 25.4744 15.892 25.5573 15.5235L27.9803 4.75426C28.0342 4.51483 27.9763 4.26398 27.823 4.07236Z" fill="white"/>
<path d="M11.8462 21.5385C10.2132 21.5385 8.88464 22.867 8.88464 24.5C8.88464 26.133 10.2132 27.4615 11.8462 27.4615C13.4792 27.4615 14.8077 26.133 14.8077 24.5C14.8077 22.867 13.4792 21.5385 11.8462 21.5385Z" fill="white"/>
<path d="M21.5385 21.5385C19.9055 21.5385 18.5769 22.867 18.5769 24.5C18.5769 26.133 19.9054 27.4615 21.5385 27.4615C23.1714 27.4615 24.5 26.133 24.5 24.5C24.5 22.867 23.1715 21.5385 21.5385 21.5385Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_3927_38">
<rect width="28" height="28" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,4 @@
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.2284 1.28215L1.22996 10.9942C0.550673 11.6541 0.568968 12.7044 1.27083 13.3401C1.97268 13.9759 3.09232 13.9564 3.77161 13.2966L13.77 3.58449C14.4493 2.92466 14.431 1.87436 13.7292 1.23858C13.0273 0.602806 11.9077 0.622311 11.2284 1.28215Z" fill="white"/>
<path d="M1.65213 3.40819L10.8751 13.7186C11.5082 14.4263 12.6262 14.5239 13.3724 13.9366C14.1185 13.3493 14.2102 12.2995 13.5771 11.5918L4.35414 1.28143C3.72107 0.573715 2.603 0.476092 1.85686 1.06338C1.11072 1.65067 1.01906 2.70048 1.65213 3.40819Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 638 B

View File

@ -0,0 +1,3 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.2094 11.6186C14.0951 10.409 14.6249 8.92328 14.6249 7.31261C14.6249 3.28064 11.3444 0.00012207 7.31245 0.00012207C3.28048 0.00012207 0 3.28064 0 7.31261C0 11.3446 3.28052 14.6251 7.31248 14.6251C8.92315 14.6251 10.409 14.0952 11.6186 13.2094L16.4092 18L18 16.4092C18 16.4092 13.2094 11.6186 13.2094 11.6186ZM7.31248 12.3751C4.52086 12.3751 2.25001 10.1042 2.25001 7.31261C2.25001 4.52098 4.52086 2.25013 7.31248 2.25013C10.1041 2.25013 12.375 4.52098 12.375 7.31261C12.375 10.1042 10.1041 12.3751 7.31248 12.3751Z" fill="#303030"/>
</svg>

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,43 @@
import React from "react";
import logoM3 from "../../assets/img/logo-m3.png";
import lupa from "../../assets/img/icon-lupa.svg";
import cart from "../../assets/img/icon-cart.svg";
import style from "./header.module.css";
const Header = () => {
return (
<div className={style["header"]}>
<div>
<div className={style["header-wrapper"]}>
<div>
<img src={logoM3} alt="logo M3" />
</div>
<div className={style["search-box"]}>
<input
className={style["input-search"]}
type="text"
placeholder="Buscar..."></input>
<img
className={style["lupa-img-none"]}
src={lupa}
alt="lupa de busca"
/>
<button type="submit" className={style["lupa-img"]}></button>
</div>
<div className={style["login"]}>
<button className={style["button-login"]}>ENTRAR</button>
<button className={style["img-cart"]}></button>
<img className={style["img-cart-none"]} src={cart} alt="carrinho" />
</div>
</div>
</div>
<div className={style["button-container"]}>
<button className={style["cursos"]}>CURSOS</button>
<button className={style["saiba-mais"]}>SAIBA MAIS</button>
<button className={style["institucionais"]}>INSTITUCIONAIS</button>
</div>
</div>
);
};
export default Header;

View File

@ -0,0 +1,54 @@
import React, { useState } from "react";
import logoM3 from "../../assets/img/logo-m3.png";
import style from "./headerMobile.module.css";
const HeaderMobile = () => {
const [open, setOpen] = useState(false);
const clickBurguer = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
setOpen(true);
};
return (
<>
<div className={style["header"]}>
<div className={style["header-wrapper"]}>
<button onClick={clickBurguer} className={style["burguer"]}></button>
<img className={style["logom3"]} src={logoM3} alt="Logo M3" />
<button className={style["cart"]}></button>
</div>
<div className={style["inputs"]}>
<div className={style["wrapper-input"]}>
<input
className={style["input"]}
type="text"
placeholder="Buscar..."></input>
<button className={style["button"]} type="submit"></button>
</div>
</div>
</div>
<div
className={`${
open
? style["menu-burguer-container-active"]
: style["menu-burguer-container"]
}`}>
<div className={style["menu-burguer-buttons"]}>
<button className={style["button-login"]}>ENTRAR</button>
<button
onClick={() => setOpen(false)}
className={style["button-close"]}></button>
</div>
<div className={style["menu-burguer-list"]}>
<ul className={style["menu-burguer-ul"]}>
<li className={style["menu-burguer-li"]}>CURSOS</li>
<li className={style["menu-burguer-li"]}>SAIBA MAIS</li>
<li className={style["menu-burguer-li"]}>INSTITUCIONAIS</li>
</ul>
</div>
</div>
</>
);
};
export default HeaderMobile;

View File

@ -0,0 +1,108 @@
.header-wrapper {
background-color: #000000;
display: flex;
align-items: center;
justify-content: space-between;
padding: 22px 100px;
}
.search-box {
display: flex;
justify-content: space-between;
background: #ffffff;
border-radius: 5px;
width: 100%;
max-width: 264px;
}
.input-search {
border: 0;
height: 14px;
outline: 0;
margin: 8px 0 8px 16px;
font-family: "Roboto";
font-weight: 400;
font-size: 14px;
line-height: 16px;
color: #c6c6c6;
width: 100%;
}
.input-search::placeholder {
color: #c6c6c6;
}
.lupa-img {
height: 18px;
width: 24px;
margin: 7px 16px 7px 10px;
content: "";
background-image: url("../../assets/img/icon-lupa.svg");
display: block;
background-size: 100% 100%;
background-repeat: no-repeat;
border: 0;
background-color: transparent;
padding: 0;
}
.lupa-img-none {
display: none;
}
.login {
display: flex;
}
.button-login {
background: transparent;
color: #ffffff;
margin: 0 55px 0 0;
font-family: "Roboto";
font-weight: 400;
font-size: 14px;
line-height: 16px;
text-transform: uppercase;
border: 0;
}
.button-container {
background: #000000;
border-top: 1px solid #c4c4c4;
padding: 14px 100px;
}
.img-cart {
width: 28px;
height: 28px;
background-image: url("../../assets/img/icon-cart.svg");
background-size: 100% 100%;
background-color: transparent;
border: 0;
}
.img-cart-none {
display: none;
}
.cursos,
.saiba-mais,
.institucionais {
font-family: "Roboto";
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 16px;
text-transform: uppercase;
color: #ffffff;
background: transparent;
border: 0;
padding: 0;
margin-right: 55px;
}
@media screen and (max-width: 1024px) {
.header {
display: none;
}
}

View File

@ -0,0 +1,159 @@
.header-wrapper {
display: flex;
justify-content: space-between;
padding: 25px 16px;
}
.header {
background: #000000;
}
.logom3 {
height: 26px;
}
.inputs {
padding: 0 16px 25px;
}
.wrapper-input {
background: #ffffff;
border: 2px solid #f0f0f0;
border-radius: 5px;
display: flex;
align-items: center;
padding: 0 16px;
}
.input {
height: 100%;
width: 100%;
height: 36px;
border: 0;
outline: 0;
font-family: "Roboto";
font-weight: 400;
font-size: 14px;
line-height: 16px;
color: #c6c6c6;
}
.input::placeholder {
color: #c6c6c6;
}
.button {
width: 18px;
height: 18px;
background-image: url(../../assets/img/icon-lupa.svg);
background-size: 100% 100%;
background-repeat: no-repeat;
border: 0;
padding: 0;
background-color: transparent;
}
.burguer {
width: 28px;
height: 22.5px;
background-image: url("../../assets/img/Group\ 33.svg");
background-size: 100% 100%;
background-color: transparent;
background-repeat: no-repeat;
border: 0;
}
.cart {
width: 28px;
height: 28px;
background-image: url("../../assets/img/icon-cart.svg");
background-size: 100% 100%;
background-color: transparent;
background-repeat: no-repeat;
border: 0;
padding: 0;
}
.menu-burguer-container {
width: 96.484375%;
position: fixed;
top: 0;
right: 100%;
transition: right 300ms ease-in-out;
}
.menu-burguer-container-active {
width: 96.484375%;
position: fixed;
top: 0;
right: 4%;
transition: right 300ms ease-in-out;
}
.menu-burguer-container-active::after {
width: 100vw;
height: 100vh;
background: rgba(69, 69, 69, 0.7);
content: "";
position: fixed;
top: 0;
left: 0;
z-index: -1;
}
.menu-burguer-buttons {
display: flex;
justify-content: space-between;
padding: 16px 31px;
background-color: #000000;
}
.button-login {
background-color: transparent;
border: 0;
font-family: "Roboto";
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 16px;
text-transform: uppercase;
color: #ffffff;
}
.button-close {
background-image: url("../../assets/img/icon-ex.svg");
background-color: transparent;
border: 0;
background-size: 100% 100%;
background-repeat: no-repeat;
width: 15px;
height: 15px;
}
.menu-burguer-list {
height: 507px;
background: #ffffff;
}
.menu-burguer-ul {
list-style: none;
padding: 16px 31px;
margin: 0;
}
.menu-burguer-li {
font-family: "Roboto";
font-style: normal;
font-weight: 500;
font-size: 14px;
line-height: 16px;
text-transform: uppercase;
color: #c4c4c4;
margin-bottom: 12px;
}
@media screen and (min-width: 1025px) {
.header {
display: none;
}
}

17
desafio5/src/index.tsx Normal file
View File

@ -0,0 +1,17 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { Home } from './pages/Home';
import './style/index.css';
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
<React.StrictMode>
<Home />
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals

View File

@ -0,0 +1,14 @@
import React from "react";
import Header from "../components/Header/Header";
import HeaderMobile from "../components/Header/HeaderMobile";
const Home = () => {
return (
<header>
<Header />
<HeaderMobile />
</header>
);
};
export { Home };

1
desafio5/src/react-app-env.d.ts vendored Normal file
View File

@ -0,0 +1 @@
/// <reference types="react-scripts" />

View File

@ -0,0 +1,19 @@
@import url("https://fonts.googleapis.com/css2?family=Roboto&display=swap");
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}

26
desafio5/tsconfig.json Normal file
View File

@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
}