Skip to content

Commit ba6a7c0

Browse files
aplicado o design recomendado pela barbiebrega
1 parent ba31363 commit ba6a7c0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/components/BackToTop/BackToTop.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { useState } from "react"
2+
import { ArrowUp } from "lucide-react"
3+
24

35
const BackToTop =() => {
46

@@ -13,6 +15,7 @@ const BackToTop =() => {
1315
}
1416

1517
document.getElementById("root")?.addEventListener('scroll', (e) => {
18+
if (e.target === null) {return}
1619
let CurrentScrollHeight = e.target.scrollTop
1720
let WindowHeight = window.innerHeight
1821

@@ -26,9 +29,12 @@ const BackToTop =() => {
2629

2730
return (isVisible && (
2831
<button
29-
className=" fixed ease-in-out duration-300 hover:bg-red-800/100 bg-red-800/40 z-[100] right-10 bottom-10 w-12 h-12 rounded-full shadow-slate-500 font-bold shadow-md text-white select-none"
32+
className=" fixed ease-in-out hidden sm:flex justify-center items-center duration-300
33+
bg-red-600/75 focus:bg-red-700 hover:bg-red-700 z-[100] shadow-slate-600/75
34+
right-6 bottom-6 rounded-full shadow-md
35+
w-12 h-12 "
3036
onClick={scrollToTop}
31-
>^</button>
37+
><ArrowUp color="white" /></button>
3238
));
3339
}
3440

0 commit comments

Comments
 (0)