From 6610a0b9d7eb9fbec591f052c960f780732bf0e5 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Mon, 29 Aug 2022 13:23:22 -0300
Subject: add senderWire to the withdrawal group again, group payto to avoid
 duplication

---
 .../src/wallet/DestinationSelection.tsx            | 28 +++++++++++++++++-----
 1 file changed, 22 insertions(+), 6 deletions(-)

(limited to 'packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx')

diff --git a/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx b/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx
index 4952ad225..fa1a606f7 100644
--- a/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx
@@ -46,12 +46,16 @@ const Container = styled.div`
   }
 `;
 
-interface Props {
-  action: "send" | "get";
+interface PropsGet {
   amount?: string;
   goToWalletManualWithdraw: (amount: string) => void;
   goToWalletWalletInvoice: (amount: string) => void;
 }
+interface PropsSend {
+  amount?: string;
+  goToWalletBankDeposit: (amount: string) => void;
+  goToWalletWalletSend: (amount: string) => void;
+}
 
 type Contact = {
   icon: string;
@@ -262,7 +266,7 @@ export function DestinationSelectionGetCash({
   amount: initialAmount,
   goToWalletManualWithdraw,
   goToWalletWalletInvoice,
-}: Props): VNode {
+}: PropsGet): VNode {
   const parsedInitialAmount = !initialAmount
     ? undefined
     : Amounts.parse(initialAmount);
@@ -390,7 +394,9 @@ export function DestinationSelectionGetCash({
 
 export function DestinationSelectionSendCash({
   amount: initialAmount,
-}: Props): VNode {
+  goToWalletBankDeposit,
+  goToWalletWalletSend,
+}: PropsSend): VNode {
   const parsedInitialAmount = !initialAmount
     ? undefined
     : Amounts.parse(initialAmount);
@@ -482,13 +488,23 @@ export function DestinationSelectionSendCash({
           <Grid item xs={1}>
             <Paper style={{ padding: 8 }}>
               <p>To my bank account</p>
-              <Button disabled={invalid}>Deposit</Button>
+              <Button
+                disabled={invalid}
+                onClick={async () => goToWalletBankDeposit(currencyAndAmount)}
+              >
+                Deposit
+              </Button>
             </Paper>
           </Grid>
           <Grid item xs={1}>
             <Paper style={{ padding: 8 }}>
               <p>To another wallet</p>
-              <Button disabled>Send</Button>
+              <Button
+                disabled={invalid}
+                onClick={async () => goToWalletWalletSend(currencyAndAmount)}
+              >
+                Send
+              </Button>
             </Paper>
           </Grid>
         </Grid>
-- 
cgit v1.2.3

