@@ -15,12 +15,15 @@ import { useSaveArtworkToArtworkLists } from "app/Components/ArtworkLists/useSav
15
15
import { GlobalStore } from "app/store/GlobalStore"
16
16
import { Schema } from "app/utils/track"
17
17
import { sizeToFit } from "app/utils/useSizeToFit"
18
- import { memo } from "react"
19
- import { LayoutAnimation , ViewStyle } from "react-native"
18
+ import { memo , useEffect } from "react"
19
+ import { ViewStyle } from "react-native"
20
20
import Animated , {
21
+ Easing ,
21
22
interpolate ,
22
23
useAnimatedStyle ,
23
24
useSharedValue ,
25
+ withDelay ,
26
+ withSequence ,
24
27
withTiming ,
25
28
} from "react-native-reanimated"
26
29
import { graphql , useFragment } from "react-relay"
@@ -82,13 +85,23 @@ export const InfiniteDiscoveryArtworkCard: React.FC<InfiniteDiscoveryArtworkCard
82
85
}
83
86
} )
84
87
85
- useAnimatedStyle ( ( ) => {
88
+ useEffect ( ( ) => {
86
89
saveAnimationProgress . value = withTiming ( isSavedProp ? 1 : 0 , {
87
90
duration : 300 ,
88
91
} )
89
- return { } // Required for ts
90
92
} , [ isSavedProp ] )
91
93
94
+ const savedArtworkAnimationStyles = useAnimatedStyle ( ( ) => {
95
+ return {
96
+ opacity : isSavedProp
97
+ ? withSequence (
98
+ withTiming ( 1 , { duration : 300 , easing : Easing . linear } ) ,
99
+ withDelay ( 500 , withTiming ( 0 , { duration : 300 , easing : Easing . linear } ) )
100
+ )
101
+ : 0 ,
102
+ }
103
+ } )
104
+
92
105
if ( ! artwork ) {
93
106
return null
94
107
}
@@ -114,6 +127,23 @@ export const InfiniteDiscoveryArtworkCard: React.FC<InfiniteDiscoveryArtworkCard
114
127
/>
115
128
</ Flex >
116
129
< Flex alignItems = "center" minHeight = { MAX_ARTWORK_HEIGHT } justifyContent = "center" >
130
+ < Animated . View
131
+ style = { [
132
+ {
133
+ position : "absolute" ,
134
+ width : "100%" ,
135
+ height : "100%" ,
136
+ backgroundColor : "rgba(255, 255, 255, 0.5)" ,
137
+ justifyContent : "center" ,
138
+ alignItems : "center" ,
139
+ zIndex : 100 ,
140
+ } ,
141
+ savedArtworkAnimationStyles ,
142
+ ] }
143
+ >
144
+ < HeartFillIcon height = { 64 } width = { 64 } fill = "white100" />
145
+ </ Animated . View >
146
+
117
147
{ ! ! src && < Image src = { src } height = { size . height } width = { size . width } /> }
118
148
</ Flex >
119
149
< Flex flexDirection = "row" justifyContent = "space-between" p = { 1 } mx = { 2 } >
0 commit comments