BlueWallet/screen/wallets/paymentCode.tsx

38 lines
991 B
TypeScript
Raw Normal View History

2022-12-06 21:43:54 -05:00
import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { NativeStackScreenProps } from 'react-native-screens/lib/typescript/native-stack';
import QRCodeComponent from '../../components/QRCodeComponent';
type PaymentCodeStackParamList = {
PaymentCode: { paymentCode: string };
};
export default function PaymentCode({ route }: NativeStackScreenProps<PaymentCodeStackParamList, 'PaymentCode'>) {
const { paymentCode } = route.params;
return (
<View style={styles.container}>
2022-12-11 21:34:50 -05:00
{!paymentCode && <Text>Payment code not found</Text>}
{paymentCode && (
<>
<QRCodeComponent value={paymentCode} />
<Text style={styles.paymentCodeText}>{paymentCode}</Text>
</>
)}
2022-12-06 21:43:54 -05:00
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
paymentCodeText: {
fontSize: 16,
marginTop: 20,
marginHorizontal: 40,
},
});