feature/footer #2

Merged
YahToth merged 7 commits from feature/footer into main 2023-01-20 21:37:27 +00:00
Showing only changes of commit 2b24ab7297 - Show all commits

View File

@ -24,6 +24,20 @@ import vtexpowered from "../../assets/images/vtexpowered.svg";
import m3developed from "../../assets/images/m3developed.svg";
const Footer = () => {
const [visible, setVisible] = useState(false);
useEffect(() => {
const handleResize = () => {
if (window.pageYOffset > 100) {
setVisible(true);
} else {
setVisible(false);
}
};
window.addEventListener("scroll", handleResize);
return () => {
window.removeEventListener("scroll", handleResize);
};
}, []);
return (
<div>
<Newsletter />
@ -197,9 +211,11 @@ const Footer = () => {
</a>
</button>
<button className={styles["button-icon"]}>
<a href="#header">
<img src={gototop} alt="" className={styles["go-top-icon"]} />
</a>
{visible && (
<a href="#header">
<img src={gototop} alt="" className={styles["go-top-icon"]} />
</a>
)}
</button>
</div>
</div>