File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { useState } from "react"
2
+ import { ArrowUp } from "lucide-react"
3
+
2
4
3
5
const BackToTop = ( ) => {
4
6
@@ -13,6 +15,7 @@ const BackToTop =() => {
13
15
}
14
16
15
17
document . getElementById ( "root" ) ?. addEventListener ( 'scroll' , ( e ) => {
18
+ if ( e . target === null ) { return }
16
19
let CurrentScrollHeight = e . target . scrollTop
17
20
let WindowHeight = window . innerHeight
18
21
@@ -26,9 +29,12 @@ const BackToTop =() => {
26
29
27
30
return ( isVisible && (
28
31
< 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 "
30
36
onClick = { scrollToTop }
31
- > ^ </ button >
37
+ > < ArrowUp color = "white" /> </ button >
32
38
) ) ;
33
39
}
34
40
You can’t perform that action at this time.
0 commit comments