forked from M3-Academy/desafio-react-e-typescript
Merge pull request 'feat: cria botão de scroll para o topo e botao de redirecionar ao whatsapp' (#16) from feature/whatsESeta into development
Reviewed-on: #16
This commit is contained in:
commit
ff0a880329
@ -24,7 +24,7 @@ h5 {
|
||||
max-width: 707px;
|
||||
|
||||
height: 100%;
|
||||
// max-height: 139px;
|
||||
|
||||
|
||||
@media (min-width:2500px) {
|
||||
|
||||
@ -34,11 +34,17 @@ h5 {
|
||||
|
||||
@media (max-width:1024px) {
|
||||
flex-direction: column;
|
||||
width: 96.875%;
|
||||
width: 99.875%;
|
||||
max-width: 992px;
|
||||
justify-content: initial;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@media (max-width:490px) {
|
||||
|
||||
width: 96.875%;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.toggle__accordion {
|
||||
|
42
src/components/Footer/ButtonsFixeds/ButtonTop.tsx
Normal file
42
src/components/Footer/ButtonsFixeds/ButtonTop.tsx
Normal file
@ -0,0 +1,42 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import buttons from "./Buttons.module.scss";
|
||||
import arrowTop from "./assets/arrowTop.svg";
|
||||
|
||||
|
||||
|
||||
export const ButtonTop = () => {
|
||||
const [showTopBtn, setShowTopBtn] = useState(false);
|
||||
useEffect(() => {
|
||||
window.addEventListener("scroll", () => {
|
||||
if (window.scrollY > 400) {
|
||||
setShowTopBtn(true);
|
||||
} else {
|
||||
setShowTopBtn(false);
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
const goToTop = () => {
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: "smooth",
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={buttons["btn__scroll"]}
|
||||
onClick={goToTop} >
|
||||
|
||||
<img src={arrowTop}
|
||||
alt="Icone de seta para cima"
|
||||
className={buttons["icone"]}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
||||
}
|
24
src/components/Footer/ButtonsFixeds/ButtonWhatsapp.tsx
Normal file
24
src/components/Footer/ButtonsFixeds/ButtonWhatsapp.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
import React from "react";
|
||||
import whatsapp from "./assets/whatsapp.svg";
|
||||
import buttons from "./Buttons.module.scss";
|
||||
|
||||
export const ButtonWhatsapp = () => {
|
||||
|
||||
return (
|
||||
|
||||
|
||||
<a
|
||||
href="https://wa.me/75982170090"
|
||||
target="_blank"
|
||||
className={buttons["link"]}
|
||||
>
|
||||
<img src={whatsapp} alt="Icone do whats" />
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
||||
}
|
59
src/components/Footer/ButtonsFixeds/Buttons.module.scss
Normal file
59
src/components/Footer/ButtonsFixeds/Buttons.module.scss
Normal file
@ -0,0 +1,59 @@
|
||||
.wrapper__buttons {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 137px;
|
||||
position: fixed;
|
||||
bottom: 25%;
|
||||
right: 16px;
|
||||
|
||||
@media (max-width:2499px) {
|
||||
height: 73px;
|
||||
position: fixed;
|
||||
bottom: 35%;
|
||||
right: 16px;
|
||||
}
|
||||
|
||||
@media (max-width:1024px) {
|
||||
height: 73px;
|
||||
bottom: 60px;
|
||||
right: 22px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
.link {
|
||||
img {
|
||||
width: 66px;
|
||||
max-height: 66px;
|
||||
|
||||
@media (max-width:2499px) {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn__scroll {
|
||||
|
||||
width: 66px;
|
||||
height: 66px;
|
||||
background-color: #C4C4C4;
|
||||
border-radius: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@media (max-width:2499px) {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
|
||||
.icone {
|
||||
width: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
14
src/components/Footer/ButtonsFixeds/Buttons.tsx
Normal file
14
src/components/Footer/ButtonsFixeds/Buttons.tsx
Normal file
@ -0,0 +1,14 @@
|
||||
import React from "react";
|
||||
import { ButtonTop } from "./ButtonTop";
|
||||
import { ButtonWhatsapp } from "./ButtonWhatsapp";
|
||||
import buttons from "./Buttons.module.scss";
|
||||
|
||||
export const Buttons = () => {
|
||||
return (
|
||||
<div className={buttons["wrapper__buttons"]}>
|
||||
<ButtonWhatsapp />
|
||||
<ButtonTop />
|
||||
</div >
|
||||
);
|
||||
|
||||
}
|
3
src/components/Footer/ButtonsFixeds/assets/arrowTop.svg
Normal file
3
src/components/Footer/ButtonsFixeds/assets/arrowTop.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="25" height="13" viewBox="0 0 25 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M23.7428 11.3959C23.741 11.6959 23.6177 11.9953 23.373 12.226L23.3728 12.2261C22.8668 12.7035 22.037 12.7035 21.5311 12.2261L21.5232 12.2345L21.5311 12.2261L12.3457 3.5599L12.0712 3.30091L11.7967 3.5599L2.61178 12.2258C2.10549 12.7033 1.27571 12.7032 0.769767 12.2259L0.769708 12.2258C0.525704 11.9957 0.402467 11.6972 0.400037 11.398C0.401876 11.0981 0.525111 10.7986 0.769782 10.5678L0.769785 10.5678L11.1506 0.773762C11.4013 0.537307 11.7333 0.415846 12.0712 0.415846C12.4093 0.415846 12.7415 0.537566 12.9922 0.773969L23.3728 10.568L23.3729 10.5681C23.6171 10.7983 23.7403 11.0968 23.7428 11.3959Z" fill="white" stroke="white" stroke-width="0.8"/>
|
||||
</svg>
|
After Width: | Height: | Size: 764 B |
11
src/components/Footer/ButtonsFixeds/assets/whatsapp.svg
Normal file
11
src/components/Footer/ButtonsFixeds/assets/whatsapp.svg
Normal 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_4136_1027)">
|
||||
<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_4136_1027">
|
||||
<rect width="66" height="66" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
@ -4,6 +4,8 @@ import { AccordionFooter } from "./Accordion/AccordionFooter";
|
||||
import { Rodape } from "./Rodape/Rodape";
|
||||
import { SocialMedia } from "./SocialMedia/SocialMedia";
|
||||
import styleFooter from "./styles/Footer.module.scss";
|
||||
|
||||
import { Buttons } from "./ButtonsFixeds/Buttons";
|
||||
export const Footer = () => {
|
||||
|
||||
return (
|
||||
@ -12,8 +14,8 @@ export const Footer = () => {
|
||||
<div className={styleFooter["footer__middle"]}>
|
||||
<AccordionFooter />
|
||||
<SocialMedia />
|
||||
<Buttons />
|
||||
</div>
|
||||
|
||||
<Rodape />
|
||||
</footer >
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
@media (max-width:1024px) {
|
||||
row-gap: 16px;
|
||||
margin: 0 16px;
|
||||
// margin: 0 16px;
|
||||
width: 96.875%;
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,14 @@
|
||||
.footer {
|
||||
width: 100%;
|
||||
|
||||
|
||||
&__middle {
|
||||
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
height: 139px;
|
||||
padding: 50px 0;
|
||||
position: relative;
|
||||
|
||||
@media (min-width:2500px) {
|
||||
height: 239px;
|
||||
|
Loading…
Reference in New Issue
Block a user