From 533dc6cf9f024f05b24f36dd08d03c40b5ee3e1d Mon Sep 17 00:00:00 2001 From: Adeed Mahar Date: Thu, 21 Mar 2024 00:54:52 +0500 Subject: [PATCH] conditioanlly execute the submitcard function --- src/components/SubmitButton.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/SubmitButton.tsx b/src/components/SubmitButton.tsx index f5e80dd..0d4bb5a 100644 --- a/src/components/SubmitButton.tsx +++ b/src/components/SubmitButton.tsx @@ -3,7 +3,7 @@ import { TouchableOpacity, Text, StyleSheet } from "react-native"; import { SubmitButtonProps } from "../types/types"; import { FramesConsumer } from "../Frames"; -const SubmitButton: React.FunctionComponent = (props) => { +const SubmitButton: React.FunctionComponent = (props: any) => { return ( {({ submitCard }) => { @@ -18,7 +18,7 @@ const SubmitButton: React.FunctionComponent = (props) => { {...touchableProps} style={[styles.buttonContainer, touchableProps.style]} onPress={(e) => { - submitCard(); + props.allowCharge && submitCard(); if (props.onPress) props.onPress(e); }} >