import * as React from 'react'; import { connect } from "react-redux"; import { SafeAreaView, TouchableOpacity, View, Text, Keyboard, ScrollView, TextInput, Dimensions } from 'react-native'; import Theme from '../../components/theme.style.js'; class PayatpumpPaymentSuccess extends React.Component { constructor(props) { super(props) } state = { email: null, keyboardHeight: 0, data: this.props.route?.params?.transactionData } componentDidMount() { this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow) this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide) } componentWillUnmount() { this.keyboardDidShowListener.remove() this.keyboardDidHideListener.remove() } _keyboardDidShow = (value) => { this.setState({ keyboardHeight: value.endCoordinates.height - 120 }) } _keyboardDidHide = () => { this.setState({ keyboardHeight: 0 }) } render() { return( {"Your transaction is" + "\n" + "successful!" + "\n" + "Payment is credited to"} {`${this.state.data.storeName}`} Transaction Date 07 Oct 2020, 12:00 PM Sales Invoice No. {this.state.data?.transactionId} Total Payment {`${'\u20B1'}${this.state.data?.totalPayment}`} Card Payment {`${'\u20B1'}${this.state.data?.cardPayment}`} Points {`${'\u20B1'}${0}`} Earned Points {`${'\u20B1'}${0}`} {/* Send receipt to Email this.setState({ email: value })} style={{ width: Dimensions.get('screen').width - 60, height: 44, textAlign: 'center', fontSize: 18, borderWidth: 0.5, borderRadius: 5, color: this.props.app_theme?.theme.colors.text, borderColor: this.props.app_theme?.theme.colors.text }} /> */} this.props.navigation.navigate('Main')} style={{ height: 50, backgroundColor: Theme.colors.primary, justifyContent: 'center', alignItems: 'center', margin: 16, borderRadius: 5 }}> Ok ) } } const mapStateToProps = (state) => { return { app_theme: state.appThemeReducer.theme } } export default connect(mapStateToProps, null)(PayatpumpPaymentSuccess)