fix(header): correção na estrutura do codigo e mudança das imagens para svgs

This commit is contained in:
Amanda de Almeida Fonseca 2023-01-18 18:20:59 -03:00
parent d77afec5fd
commit 1e2f43e8b9
14 changed files with 48 additions and 21 deletions

View File

@ -1,11 +1,11 @@
import { useState } from "react";
import SearchBar from "./SearchBar";
import { SearchBar } from "./SearchBar";
import Logo from "./assets/img/logoM3.png";
import Cart from "./assets/img/Cart.png";
import iconMenu from "./assets/img/iconMenu.png";
import Link from "../link/Link";
import HeaderLinks from "./HeaderLinks";
import MenuMobile from "./Menu-Mobile/MenuMobile";
import Cart from "./assets/svg/Cart.svg";
import iconMenu from "./assets/svg/iconMenu.svg";
import { Link } from "../link/Link";
import { HeaderLinks } from "./HeaderLinks";
import { MenuMobile } from "./Menu-Mobile/MenuMobile";
import styles from "./header.module.scss";

View File

@ -1,4 +1,4 @@
import Link from "../link/Link";
import { Link } from "../link/Link";
import styles from "./header.module.scss";
const HeaderLinks = () => {
@ -11,4 +11,4 @@ const HeaderLinks = () => {
);
};
export default HeaderLinks;
export { HeaderLinks };

View File

@ -1,6 +1,6 @@
import iconExit from "../assets/img/iconExit.png";
import Link from "../../link/Link";
import HeaderLinks from "../HeaderLinks";
import iconExit from "../assets/svg/iconExit.svg";
import { Link } from "../../link/Link";
import { HeaderLinks } from "../HeaderLinks";
import styles from "../header.module.scss";
@ -11,13 +11,15 @@ interface MenuMobileProps {
}
const MenuMobile = (props: MenuMobileProps) => {
const { onClick, active, className } = props;
return (
<>
<div
onClick={props.onClick}
className={props.active ? styles["background"] : styles[""]}
onClick={onClick}
className={active ? styles["background"] : styles[""]}
></div>
<div className={props.className}>
<div className={className}>
<div className={styles["page-header__menu-mobile--container"]}>
<div className={styles["page-header__menu-mobile--header"]}>
<Link className={styles["link"]} link="/" text="ENTRAR" />
@ -25,7 +27,7 @@ const MenuMobile = (props: MenuMobileProps) => {
className={styles["page-header__menu-mobile--button-exit"]}
aria-label="exit"
type="submit"
onClick={props.onClick}
onClick={onClick}
>
<img src={iconExit} alt="" />
</button>
@ -39,4 +41,4 @@ const MenuMobile = (props: MenuMobileProps) => {
);
};
export default MenuMobile;
export { MenuMobile };

View File

@ -1,4 +1,4 @@
import iconBusca from "./assets/img/IconBusca.png";
import iconBusca from "./assets/svg/IconBusca.svg";
import styles from "./header.module.scss";
@ -19,4 +19,4 @@ const SearchBar = () => {
);
};
export default SearchBar;
export { SearchBar };

Binary file not shown.

Before

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -0,0 +1,5 @@
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<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.8461 21.5385C10.2132 21.5385 8.88458 22.867 8.88458 24.5C8.88458 26.133 10.2131 27.4615 11.8461 27.4615C13.4791 27.4615 14.8077 26.133 14.8077 24.5C14.8077 22.867 13.4792 21.5385 11.8461 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"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,10 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_6345_1254)">
<path d="M13.2094 11.6187C14.0951 10.4091 14.6249 8.92334 14.6249 7.31267C14.6249 3.2807 11.3444 0.000183105 7.31245 0.000183105C3.28048 0.000183105 0 3.2807 0 7.31267C0 11.3446 3.28052 14.6252 7.31248 14.6252C8.92315 14.6252 10.409 14.0953 11.6186 13.2095L16.4092 18.0001L18 16.4093C18 16.4092 13.2094 11.6187 13.2094 11.6187ZM7.31248 12.3751C4.52086 12.3751 2.25001 10.1043 2.25001 7.31267C2.25001 4.52104 4.52086 2.25019 7.31248 2.25019C10.1041 2.25019 12.375 4.52104 12.375 7.31267C12.375 10.1043 10.1041 12.3751 7.31248 12.3751Z" fill="#292929"/>
</g>
<defs>
<clipPath id="clip0_6345_1254">
<rect width="18" height="18" rx="5" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 808 B

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,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

@ -5,11 +5,12 @@ export interface LinkProps {
}
const Link = (props: LinkProps) => {
const { link, text, className } = props;
return (
<a href={props.link} className={props.className}>
{props.text}
<a href={link} className={className}>
{text}
</a>
);
};
export default Link;
export { Link };