diff options
author | Sebastian <sebasjm@gmail.com> | 2021-12-23 15:17:36 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-12-23 15:17:36 -0300 |
commit | 2e71117f59e0ae6106930e705ae6a54a9839281b (patch) | |
tree | a39856486a2801f56c65de245c871ce596f8ab16 /packages/taler-wallet-webextension/src/wallet/BalancePage.tsx | |
parent | b8200de6f6c5ab9be3ff9f556c8acda013e574c3 (diff) | |
download | wallet-core-2e71117f59e0ae6106930e705ae6a54a9839281b.tar.xz |
deposit from wallet webex: wip
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/BalancePage.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/BalancePage.tsx | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/BalancePage.tsx b/packages/taler-wallet-webextension/src/wallet/BalancePage.tsx index 0a8910646..52edbbe51 100644 --- a/packages/taler-wallet-webextension/src/wallet/BalancePage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/BalancePage.tsx @@ -24,7 +24,9 @@ import * as wxApi from "../wxApi"; export function BalancePage({ goToWalletManualWithdraw, + goToWalletDeposit, }: { + goToWalletDeposit: (currency: string) => void; goToWalletManualWithdraw: () => void; }): VNode { const state = useAsyncAsHook(wxApi.getBalance); @@ -33,6 +35,7 @@ export function BalancePage({ balance={state} Linker={PageLink} goToWalletManualWithdraw={goToWalletManualWithdraw} + goToWalletDeposit={goToWalletDeposit} /> ); } @@ -41,12 +44,14 @@ export interface BalanceViewProps { balance: HookResponse<BalancesResponse>; Linker: typeof PageLink; goToWalletManualWithdraw: () => void; + goToWalletDeposit: (currency: string) => void; } export function BalanceView({ balance, Linker, goToWalletManualWithdraw, + goToWalletDeposit, }: BalanceViewProps): VNode { if (!balance) { return <div>Loading...</div>; @@ -65,28 +70,35 @@ export function BalanceView({ } if (balance.response.balances.length === 0) { return ( - <p> - <Centered style={{ marginTop: 100 }}> - <i18n.Translate> - You have no balance to show. Need some{" "} - <Linker pageName="/welcome">help</Linker> getting started? - </i18n.Translate> - <div> - <ButtonPrimary onClick={goToWalletManualWithdraw}> - Withdraw - </ButtonPrimary> - </div> - </Centered> - </p> + <Fragment> + <p> + <Centered style={{ marginTop: 100 }}> + <i18n.Translate> + You have no balance to show. Need some{" "} + <Linker pageName="/welcome">help</Linker> getting started? + </i18n.Translate> + </Centered> + </p> + <footer style={{ justifyContent: "space-between" }}> + <div /> + <ButtonPrimary onClick={goToWalletManualWithdraw}> + Withdraw + </ButtonPrimary> + </footer> + </Fragment> ); } return ( <Fragment> <section> - <BalanceTable balances={balance.response.balances} /> + <BalanceTable + balances={balance.response.balances} + goToWalletDeposit={goToWalletDeposit} + /> </section> - <footer style={{ justifyContent: "space-around" }}> + <footer style={{ justifyContent: "space-between" }}> + <div /> <ButtonPrimary onClick={goToWalletManualWithdraw}> Withdraw </ButtonPrimary> |