From 237e14399c4ada1b3cc0db8902b642d4675af462 Mon Sep 17 00:00:00 2001 From: finned-palmer Date: Sat, 31 Jul 2021 11:17:08 -0500 Subject: [PATCH] Match edouard's designs --- .../src/js/components/lib/externalInvoice.js | 133 +++++++----------- .../src/js/components/lib/feePicker.js | 2 - pkg/btc-wallet/src/js/components/lib/send.js | 67 +++++---- .../src/js/components/lib/signer.js | 43 ++++-- 4 files changed, 125 insertions(+), 120 deletions(-) diff --git a/pkg/btc-wallet/src/js/components/lib/externalInvoice.js b/pkg/btc-wallet/src/js/components/lib/externalInvoice.js index 023dbc0370..866f00a731 100644 --- a/pkg/btc-wallet/src/js/components/lib/externalInvoice.js +++ b/pkg/btc-wallet/src/js/components/lib/externalInvoice.js @@ -23,9 +23,6 @@ const ExternalInvoice = ({ payee, stopSending, satsAmount }) => { useSettings(); const [txHex, setTxHex] = useState(''); const [ready, setReady] = useState(false); - const [copiedPsbt, setCopiedPsbt] = useState(false); - const [downloadedButton, setDownloadedButton] = useState(false); - const [copiedButton, setCopiedButton] = useState(false); const [localError, setLocalError] = useState(''); const [broadcasting, setBroadcasting] = useState(false); const invoiceRef = useRef(); @@ -65,16 +62,9 @@ const ExternalInvoice = ({ payee, stopSending, satsAmount }) => { const copyPsbt = () => { copyToClipboard(psbt); - setCopiedPsbt(true); - setCopiedButton(true); - setTimeout(() => { - setCopiedPsbt(false); - setCopiedButton(false); - }, 2000); }; const downloadPsbtFile = () => { - setDownloadedButton(true); const blob = new Blob([psbt]); const downloadURL = URL.createObjectURL(blob); const link = document.createElement('a'); @@ -83,9 +73,6 @@ const ExternalInvoice = ({ payee, stopSending, satsAmount }) => { document.body.appendChild(link); link.click(); link.parentNode.removeChild(link); - setTimeout(() => { - setDownloadedButton(false); - }, 1000); }; let inputColor = 'black'; @@ -179,80 +166,65 @@ const ExternalInvoice = ({ payee, stopSending, satsAmount }) => { - copyPsbt()} - > - {copiedPsbt ? 'copied' : psbt} - - - - - Paste the signed transaction from your external wallet: - - - checkTxHex(e)} - /> - {localError !== '' && ( - - + + + - )} + + + + Signed Tx + + checkTxHex(e)} + /> + {localError !== '' && ( + + + + )} + - - - {!showModal ? null : ( + {!showFeePicker ? null : ( { /> - - + {!(signing && !error) ? null : ( { foreground="orange" /> )} + diff --git a/pkg/btc-wallet/src/js/components/lib/signer.js b/pkg/btc-wallet/src/js/components/lib/signer.js index 098e2da106..06a6dea138 100644 --- a/pkg/btc-wallet/src/js/components/lib/signer.js +++ b/pkg/btc-wallet/src/js/components/lib/signer.js @@ -1,11 +1,11 @@ import React from 'react'; -import { Box, Button } from '@tlon/indigo-react'; +import { Box, Button, Icon, Row } from '@tlon/indigo-react'; import { signMethods } from './send'; const signMethodLabels = { bridge: 'Sign with Bridge', masterTicket: 'Sign with Master Ticket', - external: 'Sign Externally', + external: 'Sign Externally (PSBT)', }; const Signer = ({ @@ -18,18 +18,32 @@ const Signer = ({ return choosingSignMethod ? ( {Object.keys(signMethods).map((method) => ( - + + + {signMethod === signMethods[method] && ( + + )} + ))} ) : ( @@ -38,6 +52,7 @@ const Signer = ({ fontSize={1} fontWeight="bold" borderRadius="24px" + mr={2} height="48px" onClick={initPayment} color={signReady ? 'white' : 'lighterGray'}