From 36861b000822c65f961f0b6b0ac0533fa462ecd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20V=C3=A9lez?= Date: Mon, 27 Sep 2021 20:53:07 -0400 Subject: [PATCH] ADD: View QRCode button on is it my address --- loc/en.json | 3 ++- screen/send/isItMyAddress.js | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/loc/en.json b/loc/en.json index af0588a55..33ea0880c 100644 --- a/loc/en.json +++ b/loc/en.json @@ -607,7 +607,8 @@ "owns": "{label} owns {address}", "enter_address": "Enter address", "check_address": "Check address", - "no_wallet_owns_address": "None of the available wallets own the provided address." + "no_wallet_owns_address": "None of the available wallets own the provided address.", + "view_qrcode": "View QRCode" }, "cc": { "change": "Change", diff --git a/screen/send/isItMyAddress.js b/screen/send/isItMyAddress.js index 3e9023e1a..6e5ad9305 100644 --- a/screen/send/isItMyAddress.js +++ b/screen/send/isItMyAddress.js @@ -19,6 +19,7 @@ const IsItMyAddress = () => { const [address, setAddress] = useState(''); const [result, setResult] = useState(''); + const [resultCleanAddress, setResultCleanAddress] = useState(); const stylesHooks = StyleSheet.create({ text: { @@ -39,12 +40,14 @@ const IsItMyAddress = () => { const _result = []; for (const w of wallets) { if (w.weOwnAddress(cleanAddress)) { + setResultCleanAddress(cleanAddress); _result.push(loc.formatString(loc.is_it_my_address.owns, { label: w.getLabel(), address: cleanAddress })); } } if (_result.length === 0) { setResult(_result.push(loc.is_it_my_address.no_wallet_owns_address)); + setResultCleanAddress(); } setResult(_result.join('\n\n')); @@ -52,6 +55,7 @@ const IsItMyAddress = () => { const onBarScanned = value => { setAddress(value); + setResultCleanAddress(value); }; const importScan = () => { @@ -72,6 +76,16 @@ const IsItMyAddress = () => { const clearAddressInput = () => { setAddress(''); setResult(); + setResultCleanAddress(); + }; + + const viewQRCode = () => { + navigate('ReceiveDetailsRoot', { + screen: 'ReceiveDetails', + params: { + address: resultCleanAddress, + }, + }); }; return ( @@ -105,6 +119,12 @@ const IsItMyAddress = () => { + {resultCleanAddress && ( + <> + + + + )}