Skip to content

Commit

Permalink
fix: made fadebackdrop not close on any click
Browse files Browse the repository at this point in the history
  • Loading branch information
Vali-98 committed Oct 27, 2024
1 parent c6753c8 commit e87306d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/components/FadeBackdrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ type FadeScreenProps = {
}

const FadeBackrop: React.FC<FadeScreenProps> = ({ handleOverlayClick, children }) => {
const onBackdropPress = (e: GestureResponderEvent) => {
if (handleOverlayClick && e.target === e.currentTarget) handleOverlayClick(e)
}

return (
<Animated.View entering={FadeIn} exiting={FadeOut} style={styles.absolute}>
<TouchableOpacity
activeOpacity={1}
onPress={handleOverlayClick}
style={styles.absolute}>
<TouchableOpacity activeOpacity={1} onPress={onBackdropPress} style={styles.absolute}>
{children}
</TouchableOpacity>
</Animated.View>
Expand Down

0 comments on commit e87306d

Please sign in to comment.