BlueWallet/screen/wallets/paymentCode.tsx

34 lines
969 B
TypeScript
Raw Normal View History

2024-02-24 06:27:17 -05:00
import { NativeStackScreenProps } from '@react-navigation/native-stack';
2022-12-06 21:43:54 -05:00
import React from 'react';
2024-02-24 06:27:17 -05:00
import { StyleSheet, Text, View } from 'react-native';
2023-02-09 20:57:29 -05:00
import { BlueCopyTextToClipboard } from '../../BlueComponents';
2024-02-24 06:27:17 -05:00
import { PaymentCodeStackParamList } from '../../Navigation';
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
2024-02-24 06:27:17 -05:00
type Props = NativeStackScreenProps<PaymentCodeStackParamList, 'PaymentCode'>;
2022-12-06 21:43:54 -05:00
2024-02-24 06:27:17 -05:00
export default function PaymentCode({ route }: Props) {
2022-12-06 21:43:54 -05:00
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',
},
});