File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/components/StartWithEthereumFlow Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ const StartWithEthereumFlow = ({
16
16
newToCryptoWallets : Wallet [ ]
17
17
} ) => {
18
18
const swiperRef = useRef < SwiperRef > ( null )
19
+ const containerRef = useRef < HTMLDivElement > ( null )
19
20
const [ activeIndex , setActiveIndex ] = useState ( 1 )
20
21
const [ totalSlides , setTotalSlides ] = useState ( 0 )
21
22
const [ slideHeights , setSlideHeights ] = useState < number [ ] > ( [ ] )
@@ -50,10 +51,9 @@ const StartWithEthereumFlow = ({
50
51
51
52
const handleNext = ( ) => {
52
53
swiperRef . current ?. swiper . slideNext ( )
53
- const container = document . getElementById ( "start-with-ethereum-flow" )
54
54
55
- if ( container ) {
56
- const containerRect = container . getBoundingClientRect ( )
55
+ if ( containerRef . current ) {
56
+ const containerRect = containerRef . current . getBoundingClientRect ( )
57
57
window . scrollTo ( {
58
58
top : window . scrollY + containerRect . top - 90 ,
59
59
behavior : "smooth" ,
@@ -63,6 +63,7 @@ const StartWithEthereumFlow = ({
63
63
64
64
return (
65
65
< SwiperContainer
66
+ ref = { containerRef }
66
67
className = { cn (
67
68
"-mx-8" ,
68
69
"w-screen" ,
You can’t perform that action at this time.
0 commit comments