forked from M3-Academy/desafio-react-e-typescript
feature/header #1
BIN
desafio-react-typescript/src/assets/imgs/Logo-M3Academy.png
Normal file
BIN
desafio-react-typescript/src/assets/imgs/Logo-M3Academy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
12
desafio-react-typescript/src/assets/svgs/carrinho.svg
Normal file
12
desafio-react-typescript/src/assets/svgs/carrinho.svg
Normal 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_5048_970)">
|
||||
<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_5048_970">
|
||||
<rect width="28" height="28" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
@ -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 |
3
desafio-react-typescript/src/assets/svgs/lupa.svg
Normal file
3
desafio-react-typescript/src/assets/svgs/lupa.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 |
@ -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 |
@ -0,0 +1,3 @@
|
||||
.header {
|
||||
position: relative;
|
||||
}
|
17
desafio-react-typescript/src/components/Header/Header.tsx
Normal file
17
desafio-react-typescript/src/components/Header/Header.tsx
Normal file
@ -0,0 +1,17 @@
|
||||
import React, { useState } from "react";
|
||||
import HeaderBottom from "./components/HeaderBottom";
|
||||
import HeaderTop from "./components/HeaderTop";
|
||||
import styles from "./Header.module.scss";
|
||||
|
||||
const Header = () => {
|
||||
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
return (
|
||||
<header className={styles["header"]}>
|
||||
<HeaderTop isOpen={isOpen} setIsOpen={setIsOpen}/>
|
||||
<HeaderBottom isOpen={isOpen} setIsOpen={setIsOpen}/>
|
||||
</header>
|
||||
)
|
||||
}
|
||||
|
||||
export default Header;
|
@ -0,0 +1,86 @@
|
||||
@import "../../../styles/all.scss";
|
||||
|
||||
.headerBottom {
|
||||
border-top: 1px solid $primary-600;
|
||||
background: $black;
|
||||
|
||||
padding: 14px 100px;
|
||||
|
||||
@include mq($lg, max) {
|
||||
position: absolute;
|
||||
background-color: $white;
|
||||
background: rgba(69, 69, 69, 0.7);
|
||||
|
||||
top: 0;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
|
||||
left: -100%;
|
||||
|
||||
transition: all 0.3s linear;
|
||||
|
||||
}
|
||||
|
||||
&__active {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
&__head {
|
||||
display: none;
|
||||
|
||||
@include mq($lg, max) {
|
||||
@include display(flex, row, center, space-between);
|
||||
padding: 31px 16px;
|
||||
background-color: $black;
|
||||
|
||||
width: 96.484375%;
|
||||
}
|
||||
|
||||
@include mq($sm, max) {
|
||||
width: 90.4%;
|
||||
}
|
||||
}
|
||||
|
||||
&__login {
|
||||
@include fontStyle(400, 14px, 16px, $white);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
&__container {
|
||||
display: flex;
|
||||
gap: 55px;
|
||||
|
||||
@include mq($lg, max) {
|
||||
padding: 31px 16px;
|
||||
display: block;
|
||||
width: 96.484375%;
|
||||
height: 507px;
|
||||
|
||||
background-color: white;
|
||||
|
||||
li {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@include mq($sm, max) {
|
||||
width: 90.4%;
|
||||
}
|
||||
}
|
||||
|
||||
&__content {
|
||||
@include fontStyle(500, 14px, 16px, $white);
|
||||
text-transform: uppercase;
|
||||
|
||||
@include mq($lg, max) {
|
||||
@include fontStyle(500, 14px, 16px, $primary-600);
|
||||
}
|
||||
|
||||
@include mq($xl, min) {
|
||||
@include fontStyleResponsive(28px, 33px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,50 @@
|
||||
import React from "react";
|
||||
import styles from "./HeaderBottom.module.scss";
|
||||
|
||||
import close from "../../../assets/svgs/close-button.svg";
|
||||
|
||||
interface HeaderBottomProps {
|
||||
isOpen: boolean;
|
||||
setIsOpen(value: boolean): void;
|
||||
}
|
||||
|
||||
const HeaderBottom = ({ isOpen, setIsOpen }: HeaderBottomProps) => {
|
||||
return (
|
||||
<div
|
||||
className={
|
||||
isOpen
|
||||
? `${styles["headerBottom"]} ${styles["headerBottom__active"]}`
|
||||
: `${styles["headerBottom"]}`
|
||||
}
|
||||
>
|
||||
<div className={styles["headerBottom__head"]}>
|
||||
<p className={styles["headerBottom__login"]}>Entrar</p>
|
||||
<button
|
||||
className={styles["headerBottom__close-button "]}
|
||||
onClick={() => setIsOpen(false)}
|
||||
>
|
||||
<img src={close} alt="Fechar" />
|
||||
</button>
|
||||
</div>
|
||||
<ul className={styles["headerBottom__container"]}>
|
||||
<li>
|
||||
<a className={styles["headerBottom__content"]} href="/">
|
||||
Cursos
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a className={styles["headerBottom__content"]} href="/">
|
||||
Saiba Mais
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a className={styles["headerBottom__content"]} href="/">
|
||||
Institucionais
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default HeaderBottom;
|
@ -0,0 +1,123 @@
|
||||
@import "../../../styles/all.scss";
|
||||
|
||||
|
||||
.headerTop {
|
||||
@include display(flex, row, center, space-between);
|
||||
|
||||
padding: 22px 100px;
|
||||
background: $black;
|
||||
|
||||
@include mq($lg, max) {
|
||||
padding: 25px 16px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__menu-container {
|
||||
display: none;
|
||||
@include mq($lg, max) {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
&__image-container {
|
||||
width: 12.59259259%;
|
||||
min-width: 100px;
|
||||
|
||||
@include mq($lg, max) {
|
||||
width: 13.709678%;
|
||||
}
|
||||
|
||||
@include mq($sm, max) {
|
||||
width: 39.650145%;
|
||||
}
|
||||
|
||||
@include mq($xl, min) {
|
||||
width: 11.549%;
|
||||
}
|
||||
}
|
||||
|
||||
&__image {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__input-container {
|
||||
position: relative;
|
||||
width: 22.77777777778%;
|
||||
|
||||
@include mq($lg, max) {
|
||||
order: 3;
|
||||
width: 100%;
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
@include mq($xl, min) {
|
||||
width: 22.4185%;
|
||||
}
|
||||
}
|
||||
|
||||
&__input {
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
padding: 8px 44px 8px 16px;
|
||||
|
||||
@include borderStyle(2px, $primary-700, 5px);
|
||||
@include fontStyle(400, 14px, 16px, $primary-500);
|
||||
|
||||
@include mq($lg, max) {
|
||||
height: 35px;
|
||||
padding: 10px 44px 10px 16px ;
|
||||
}
|
||||
|
||||
@include mq($xl, min) {
|
||||
height: 57px;
|
||||
padding: 12px 64px 12px 16px;
|
||||
|
||||
@include fontStyleResponsive(28px, 33px);
|
||||
}
|
||||
}
|
||||
|
||||
&__lupa-wrapper {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 0;
|
||||
margin-right: 16px;
|
||||
transform: translateY(-50%);
|
||||
|
||||
@include mq($xl, min) {
|
||||
width: 35.15px;
|
||||
height: 35.15px;
|
||||
|
||||
margin-right: 16.47px;
|
||||
}
|
||||
}
|
||||
|
||||
&__login-container {
|
||||
@include display(flex, row, center, space-between);
|
||||
gap: 55px;
|
||||
}
|
||||
|
||||
&__login {
|
||||
@include fontStyle(400, 14px, 16px, $white);
|
||||
text-transform: uppercase;
|
||||
|
||||
@include mq($lg, max) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@include mq($xl, min) {
|
||||
@include fontStyleResponsive(28px, 33px);
|
||||
}
|
||||
}
|
||||
|
||||
&__minicart-container {
|
||||
@include mq($xl, min) {
|
||||
width: 54.68px;
|
||||
height: 54.68px;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
import React, { useState } from "react";
|
||||
|
||||
import logoM3Academy from "../../../assets/imgs/Logo-M3Academy.png";
|
||||
import carrinho from "../../../assets/svgs/carrinho.svg";
|
||||
import lupa from "../../../assets/svgs/lupa.svg";
|
||||
import menu from "../../../assets/svgs/menu-hamburguer.svg";
|
||||
|
||||
import styles from "./HeaderTop.module.scss";
|
||||
|
||||
interface HeaderTopProps {
|
||||
isOpen: boolean;
|
||||
setIsOpen(value: boolean): void;
|
||||
}
|
||||
|
||||
const HeaderTop = ({ isOpen, setIsOpen }: HeaderTopProps) => {
|
||||
const [value, setValue] = useState("");
|
||||
|
||||
return (
|
||||
<div className={styles["headerTop"]}>
|
||||
<div className={styles["headerTop__menu-container"]}>
|
||||
<button
|
||||
className={styles["headerTop__menu-mobile"]}
|
||||
onClick={() => setIsOpen(true)}
|
||||
>
|
||||
<img className={styles["headerTop__menu"]} src={menu} alt="Menu" />
|
||||
</button>
|
||||
</div>
|
||||
<figure className={styles["headerTop__image-container"]}>
|
||||
<img
|
||||
className={styles["headerTop__image"]}
|
||||
src={logoM3Academy}
|
||||
alt="Logo da M3 Academy"
|
||||
/>
|
||||
</figure>
|
||||
<div className={styles["headerTop__input-container"]}>
|
||||
<input
|
||||
value={value}
|
||||
onChange={(e) => setValue(e.target.value)}
|
||||
className={styles["headerTop__input"]}
|
||||
type="search"
|
||||
placeholder="Buscar..."
|
||||
/>
|
||||
<button
|
||||
className={styles["headerTop__lupa-wrapper"]}
|
||||
onClick={() => setValue("")}
|
||||
>
|
||||
<img src={lupa} alt="Lupa" />
|
||||
</button>
|
||||
</div>
|
||||
<div className={styles["headerTop__login-container"]}>
|
||||
<a className={styles["headerTop__login"]} href="/">
|
||||
Entrar
|
||||
</a>
|
||||
<button className={styles["headerTop__minicart-container"]}>
|
||||
<img src={carrinho} alt="Carrinho" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default HeaderTop;
|
@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import "./global.scss";
|
||||
import "./styles/global.scss";
|
||||
|
||||
import { Institucional } from "./pages/Institucional";
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
import React from "react";
|
||||
import Header from "../components/Header/Header";
|
||||
|
||||
const Institucional = () => {
|
||||
return (
|
||||
<div>
|
||||
<h1>Institucional</h1>
|
||||
</div>
|
||||
<>
|
||||
<Header />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
2
desafio-react-typescript/src/styles/all.scss
Normal file
2
desafio-react-typescript/src/styles/all.scss
Normal file
@ -0,0 +1,2 @@
|
||||
@import "./mixins.scss";
|
||||
@import "variaveis.scss";
|
@ -1,6 +1,34 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap');
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
font-family: "Roboto", sans-serif;
|
||||
}
|
||||
|
||||
input,
|
||||
button {
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button {
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
input[type="search"]::-webkit-search-decoration,
|
||||
input[type="search"]::-webkit-search-cancel-button,
|
||||
input[type="search"]::-webkit-search-results-button,
|
||||
input[type="search"]::-webkit-search-results-decoration {
|
||||
display: none;
|
||||
}
|
||||
|
31
desafio-react-typescript/src/styles/mixins.scss
Normal file
31
desafio-react-typescript/src/styles/mixins.scss
Normal file
@ -0,0 +1,31 @@
|
||||
@mixin display($display, $fd, $al, $jc) {
|
||||
display: $display;
|
||||
flex-direction: $fd;
|
||||
align-items: $al;
|
||||
justify-content: $jc;
|
||||
}
|
||||
|
||||
@mixin fontStyle($fw, $fs, $lh, $fc) {
|
||||
font-weight: $fw;
|
||||
font-size: $fs;
|
||||
line-height: $lh;
|
||||
color: $fc;
|
||||
}
|
||||
|
||||
@mixin fontStyleResponsive($fs, $lh) {
|
||||
font-size: $fs;
|
||||
line-height: $lh;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@mixin borderStyle($bpx, $bc, $br) {
|
||||
border: $bpx solid $bc;
|
||||
border-radius: $br;
|
||||
}
|
||||
|
||||
@mixin mq($width, $type) {
|
||||
@media only screen and (#{$type}-width: $width) {
|
||||
@content;
|
||||
}
|
||||
}
|
@ -11,4 +11,9 @@ $primary-500: #C6C6C6;
|
||||
$primary-600: #C4C4C4;
|
||||
$primary-700: #F2F2F2;
|
||||
$primary-800: #F9F9F9;
|
||||
$primary-900: #FF0000;
|
||||
$primary-900: #FF0000;
|
||||
|
||||
//media Queries
|
||||
$sm: 375px;
|
||||
$lg: 1024px;
|
||||
$xl: 2500px;
|
Loading…
Reference in New Issue
Block a user