BlueWallet/screen/wallets/paymentCode.tsx

35 lines
983 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';
2023-02-09 20:57:29 -05:00
import { BlueCopyTextToClipboard } from '../../BlueComponents';
2022-12-06 21:43:54 -05:00
import QRCodeComponent from '../../components/QRCodeComponent';
2023-04-06 19:29:34 +03:00
import loc from '../../loc';
2022-12-06 21:43:54 -05:00
type PaymentCodeStackParamList = {
PaymentCode: { paymentCode: string };
};
export default function PaymentCode({ route }: NativeStackScreenProps<PaymentCodeStackParamList, 'PaymentCode'>) {
const { paymentCode } = route.params;
return (
<View style={styles.container}>
2023-04-06 19:29:34 +03:00
{!paymentCode && <Text>{loc.bip47.not_found}</Text>}
2022-12-11 21:34:50 -05:00
{paymentCode && (
<>
<QRCodeComponent value={paymentCode} />
2023-02-09 20:57:29 -05:00
<BlueCopyTextToClipboard text={paymentCode} />
2022-12-11 21:34:50 -05:00
</>
)}
2022-12-06 21:43:54 -05:00
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
});