forked from M3-Academy/desafio-react-e-typescript
feat: Criação do Header Desktop
This commit is contained in:
parent
7337ec933b
commit
e7c01f8c83
12
public/assets/icons/cart-icon.svg
Normal file
12
public/assets/icons/cart-icon.svg
Normal file
@ -0,0 +1,12 @@
|
||||
<svg viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet">
|
||||
<g clip-path="url(#clip0_3856_4)">
|
||||
<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_3856_4">
|
||||
<rect width="100%" height="100%" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
3
public/assets/icons/search-icon.svg
Normal file
3
public/assets/icons/search-icon.svg
Normal 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 |
BIN
public/assets/images/Logo-M3Academy.png
Normal file
BIN
public/assets/images/Logo-M3Academy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
@ -4,6 +4,11 @@
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
||||
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta
|
||||
name="description"
|
||||
@ -24,7 +29,7 @@
|
||||
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>React App</title>
|
||||
<title>Institucional - M3 Academy</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
28
src/components/Header/Header.tsx
Normal file
28
src/components/Header/Header.tsx
Normal file
@ -0,0 +1,28 @@
|
||||
import styles from "./header.module.scss";
|
||||
|
||||
export function Header() {
|
||||
return (
|
||||
<header className={styles.header}>
|
||||
<img
|
||||
className={styles.logo}
|
||||
src="/assets/images/Logo-M3Academy.png"
|
||||
alt="Logo M3 Academy"
|
||||
/>
|
||||
<form className={styles.formSearch} action="#">
|
||||
<input
|
||||
type="search"
|
||||
id="search"
|
||||
name="search"
|
||||
placeholder="Buscar..."
|
||||
/>
|
||||
<button type="submit">
|
||||
<img src="/assets/icons/search-icon.svg" alt="Buscar" />
|
||||
</button>
|
||||
</form>
|
||||
<div className={styles.entrarContainer}>
|
||||
<span>Entrar</span>
|
||||
<img src="/assets/icons/cart-icon.svg" alt="Carrinho" />
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
76
src/components/Header/header.module.scss
Normal file
76
src/components/Header/header.module.scss
Normal file
@ -0,0 +1,76 @@
|
||||
.header {
|
||||
background: var(--black);
|
||||
// height: 76px;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 100px;
|
||||
|
||||
.logo {
|
||||
width: 12.5925%;
|
||||
|
||||
padding: 25px 0;
|
||||
}
|
||||
|
||||
.formSearch {
|
||||
width: 24.44%;
|
||||
height: 32px;
|
||||
|
||||
background: var(--white);
|
||||
|
||||
border: 2px solid #f2f2f2;
|
||||
border-radius: 5px;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
input {
|
||||
background: transparent;
|
||||
padding: 0 10px 0 16px;
|
||||
flex: 1;
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
line-height: 16px;
|
||||
|
||||
color: var(--gray-400);
|
||||
|
||||
&::placeholder {
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
line-height: 16px;
|
||||
|
||||
color: var(--gray-400);
|
||||
}
|
||||
}
|
||||
|
||||
button {
|
||||
background: transparent;
|
||||
height: 18px;
|
||||
padding-right: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.entrarContainer {
|
||||
width: 12.5925%;
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
color: var(--white);
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
line-height: 16px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 20.5882%;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
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;
|
||||
}
|
27
src/global.scss
Normal file
27
src/global.scss
Normal file
@ -0,0 +1,27 @@
|
||||
:root {
|
||||
--black: #000000;
|
||||
--black-100: #303030;
|
||||
|
||||
--white: #ffffff;
|
||||
|
||||
--gray-500: #7d7d7d;
|
||||
--gray-400: #c4c4c4;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Roboto", sans-serif;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
||||
monospace;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import "./global.css";
|
||||
import "./global.scss";
|
||||
import Home from "./pages/Home";
|
||||
|
||||
const root = ReactDOM.createRoot(
|
||||
|
@ -1,7 +1,8 @@
|
||||
import React from "react";
|
||||
import { Header } from "../components/Header/Header";
|
||||
|
||||
function Home() {
|
||||
return <h1>Hello World!</h1>;
|
||||
return <Header />;
|
||||
}
|
||||
|
||||
export default Home;
|
||||
|
1
src/types/index.d.ts
vendored
Normal file
1
src/types/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
declare module "*.module.scss";
|
@ -1,11 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
@ -20,7 +16,5 @@
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx"
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
"include": ["src"]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user