File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
website/src/components/StickyGrid Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
- import React , { ComponentProps , useRef } from "react" ;
1
+ import React , { ComponentProps , useId , useRef } from "react" ;
2
2
import {
3
3
AnimatePresence ,
4
4
motion ,
@@ -33,6 +33,7 @@ export const StickyGrid = ({ cards }: Props) => {
33
33
) ;
34
34
setActiveCard ( closestBreakpointIndex ) ;
35
35
} ) ;
36
+ const id = useId ( ) ;
36
37
37
38
return (
38
39
< div className = "w-full flex flex-row gap-20" ref = { ref } >
@@ -50,11 +51,13 @@ export const StickyGrid = ({ cards }: Props) => {
50
51
) ) }
51
52
</ div >
52
53
< div className = "sticky top-24 right-0 hidden aspect-[3/2] h-full w-1/2 overflow-hidden rounded-md md:block" >
53
- < AnimatePresence initial = { false } >
54
+ < AnimatePresence mode = "popLayout" >
54
55
< motion . div
55
56
key = { activeCardIndex }
56
57
initial = { { opacity : 0 } }
57
58
animate = { { opacity : 1 } }
59
+ exit = { { opacity : 0 } }
60
+ transition = { { duration : 0.5 } }
58
61
>
59
62
{ cards [ activeCardIndex ] . image }
60
63
</ motion . div >
You can’t perform that action at this time.
0 commit comments