Skip to content

Commit c92ed5b

Browse files
authored
fix: issue with interaction (#11658)
1 parent 998a918 commit c92ed5b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/app/Scenes/InfiniteDiscovery/Components/Swiper/AnimatedView.tsx

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useScreenDimensions } from "@artsy/palette-mobile"
22
import { useScreenWidthWithOffset } from "app/Scenes/InfiniteDiscovery/Components/Swiper/useScreenWidthWithOffset"
3-
import { FC, Key, ReactElement } from "react"
3+
import { FC, Key } from "react"
44
import { ViewStyle } from "react-native"
55
import Animated, {
66
Extrapolation,
@@ -17,25 +17,24 @@ interface AnimatedViewProps {
1717
activeIndex: SharedValue<number>
1818
swipedKeys: SharedValue<Key[]>
1919
style?: ViewStyle | ViewStyle[]
20-
children: ReactElement
21-
key: string
20+
internalID: string
2221
}
2322

2423
export const AnimatedView: FC<AnimatedViewProps> = ({
24+
children,
2525
activeCardX,
2626
swipedCardX,
2727
activeIndex,
2828
index,
2929
swipedKeys,
30-
children,
31-
key,
30+
internalID,
3231
}) => {
3332
const { width: screenWidth } = useScreenDimensions()
3433
const width = useScreenWidthWithOffset()
3534

3635
const isTopCard = useDerivedValue(() => activeIndex.value === index)
3736
const isSecondCard = useDerivedValue(() => activeIndex.value - 1 === index)
38-
const isSwiped = useDerivedValue(() => swipedKeys.value.includes(key as Key))
37+
const isSwiped = useDerivedValue(() => swipedKeys.value.includes(internalID as Key))
3938
const isThirdOrMoreCard = useDerivedValue(() => index < activeIndex.value - 1 && !isSwiped.value)
4039
const isLastSwiped = useDerivedValue(() => activeIndex.value + 1 === index)
4140

@@ -158,4 +157,4 @@ const MAX_ROTATIONS = [5, 7, 9]
158157
const MAX_SHADOW_OPACITY = 0.8
159158
const MAX_ELEVATION = 8
160159
const MIN_SCALE = 0.95
161-
const MIN_OPACITY = 0.75
160+
const MIN_OPACITY = 0.5

src/app/Scenes/InfiniteDiscovery/Components/Swiper/Swiper.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ export const Swiper = forwardRef<SwiperRefProps, SwiperProps>(
235235
swipedKeys={swipedKeys}
236236
swipedCardX={swipedCardX}
237237
key={c.internalID}
238+
internalID={c.internalID}
238239
>
239240
<InfiniteDiscoveryArtworkCard
240241
artwork={c}

0 commit comments

Comments
 (0)