BlueWallet/screen/wallets/paymentCode.tsx

34 lines
969 B
TypeScript
Raw Normal View History

2024-02-24 12:27:17 +01:00
import { NativeStackScreenProps } from '@react-navigation/native-stack';
2022-12-07 03:43:54 +01:00
import React from 'react';
2024-02-24 12:27:17 +01:00
import { StyleSheet, Text, View } from 'react-native';
2023-02-10 02:57:29 +01:00
import { BlueCopyTextToClipboard } from '../../BlueComponents';
2024-02-24 12:27:17 +01:00
import { PaymentCodeStackParamList } from '../../Navigation';
2022-12-07 03:43:54 +01:00
import QRCodeComponent from '../../components/QRCodeComponent';
2023-04-06 18:29:34 +02:00
import loc from '../../loc';
2022-12-07 03:43:54 +01:00
2024-02-24 12:27:17 +01:00
type Props = NativeStackScreenProps<PaymentCodeStackParamList, 'PaymentCode'>;
2022-12-07 03:43:54 +01:00
2024-02-24 12:27:17 +01:00
export default function PaymentCode({ route }: Props) {
2022-12-07 03:43:54 +01:00
const { paymentCode } = route.params;
return (
<View style={styles.container}>
2023-04-06 18:29:34 +02:00
{!paymentCode && <Text>{loc.bip47.not_found}</Text>}
2022-12-12 03:34:50 +01:00
{paymentCode && (
<>
<QRCodeComponent value={paymentCode} />
2023-02-10 02:57:29 +01:00
<BlueCopyTextToClipboard text={paymentCode} />
2022-12-12 03:34:50 +01:00
</>
)}
2022-12-07 03:43:54 +01:00
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
});