feat(institucional): created fixed icons

This commit is contained in:
Marcello Rodrigues Martins 2023-01-20 21:13:01 -03:00
parent 38f3e8fccf
commit 2f954f0001
5 changed files with 94 additions and 0 deletions

View File

@ -5,6 +5,10 @@ import Header from "./components/Header";
import NewsLetter from "./components/newsLetter";
import Institutional from "./pages/Institutional";
import Footer from "./components/Footer";
import FixedIcons from "./components/FixedIcon";
import Up from "./assets/svg/Up.svg";
import Wpp from "./assets/svg/Wpp.svg";
import { url } from "inspector";
const router = createBrowserRouter([
{
@ -19,6 +23,22 @@ function App() {
<Header />
<RouterProvider router={router} />
<NewsLetter />
<FixedIcons
icons={[
{
action: () => {
window.scrollTo({ top: 0, behavior: "smooth" });
},
imgUrl: Up,
},
{
action: () => {
window.open("https://api.whatsapp.com/send?phone=552225215720");
},
imgUrl: Wpp,
},
]}
/>
<Footer />
</div>
);

4
src/assets/svg/Up.svg Normal file
View File

@ -0,0 +1,4 @@
<svg width="66" height="66" viewBox="0 0 66 66" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M66 33C66 51.2254 51.2254 66 33 66C14.7746 66 0 51.2254 0 33C0 14.7746 14.7746 0 33 0C51.2254 0 66 14.7746 66 33Z" fill="#C4C4C4"/>
<path d="M44.7428 36.3959C44.741 36.6959 44.6177 36.9953 44.373 37.226L44.3728 37.2261C43.8668 37.7035 43.037 37.7035 42.5311 37.2261L42.5232 37.2345L42.5311 37.2261L33.3457 28.5599L33.0712 28.3009L32.7967 28.5599L23.6118 37.2258C23.1055 37.7033 22.2757 37.7032 21.7698 37.2259L21.7697 37.2258C21.5257 36.9957 21.4025 36.6972 21.4 36.398C21.4019 36.0981 21.5251 35.7986 21.7698 35.5678L21.7698 35.5678L32.1506 25.7738C32.4013 25.5373 32.7333 25.4158 33.0712 25.4158C33.4093 25.4158 33.7415 25.5376 33.9922 25.774L44.3728 35.568L44.3729 35.5681C44.6171 35.7983 44.7403 36.0968 44.7428 36.3959Z" fill="white" stroke="white" stroke-width="0.8"/>
</svg>

After

Width:  |  Height:  |  Size: 887 B

11
src/assets/svg/Wpp.svg Normal file
View File

@ -0,0 +1,11 @@
<svg width="66" height="66" viewBox="0 0 66 66" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_4336_1042)">
<path d="M33.0083 0H32.9917C14.7964 0 0 14.8005 0 33C0 40.2188 2.3265 46.9095 6.28237 52.3421L2.16975 64.6016L14.8541 60.5468C20.0723 64.0035 26.2969 66 33.0083 66C51.2036 66 66 51.1954 66 33C66 14.8046 51.2036 0 33.0083 0Z" fill="#4CAF50"/>
<path d="M52.2103 46.6001C51.4142 48.8483 48.2544 50.7128 45.734 51.2573C44.0098 51.6244 41.7575 51.9173 34.1758 48.774C24.4779 44.7563 18.2326 34.9016 17.7459 34.2623C17.2798 33.6229 13.8271 29.0441 13.8271 24.3086C13.8271 19.5731 16.232 17.2673 17.2014 16.2773C17.9975 15.4646 19.3134 15.0934 20.5756 15.0934C20.984 15.0934 21.3511 15.114 21.6811 15.1305C22.6505 15.1718 23.1373 15.2295 23.7766 16.7599C24.5728 18.678 26.5115 23.4135 26.7425 23.9003C26.9776 24.387 27.2128 25.047 26.8828 25.6864C26.5734 26.3464 26.3011 26.6393 25.8144 27.2003C25.3276 27.7613 24.8656 28.1903 24.3789 28.7925C23.9334 29.3164 23.4301 29.8774 23.9911 30.8468C24.5521 31.7955 26.4909 34.9594 29.3454 37.5004C33.029 40.7798 36.0155 41.8275 37.0839 42.273C37.88 42.603 38.8288 42.5246 39.4104 41.9059C40.1488 41.1098 41.0604 39.7898 41.9885 38.4904C42.6485 37.5581 43.4818 37.4426 44.3563 37.7726C45.2473 38.082 49.9622 40.4126 50.9315 40.8953C51.9009 41.382 52.5403 41.613 52.7754 42.0214C53.0064 42.4298 53.0064 44.3479 52.2103 46.6001Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_4336_1042">
<rect width="66" height="66" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,21 @@
import styles from "./styles.module.scss";
import { isContinueStatement } from "@babel/types";
interface FixedIconsProps {
imgUrl: string;
action: () => void;
}
export default function FixedIcons({ icons }: { icons: FixedIconsProps[] }) {
return (
<div className={styles.fixedContainer}>
{icons.map((icon) => {
return (
<button onClick={icon.action}>
<img src={icon.imgUrl} alt="" />
</button>
);
})}
</div>
);
}

View File

@ -0,0 +1,38 @@
.fixedContainer {
position: fixed;
right: 16px;
bottom: 189px;
z-index: 10000;
display: flex;
flex-direction: column-reverse;
gap: 5px;
button {
border: 0;
width: 34px;
height: 34px;
background: none;
cursor: pointer;
img {
height: 100%;
}
}
}
@media screen and (min-width: 2500px) {
.fixedContainer {
bottom: 229px;
button {
width: 66px;
height: 66px;
}
}
}
@media screen and (max-width: 1024px) {
.fixedContainer {
bottom: 29px;
}
}