From 5ec344290efd937fa82c0704bc7c204a0bf14c78 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 30 Aug 2019 17:27:59 +0200 Subject: support for tipping protocol changes --- src/webex/pages/tip.tsx | 203 +++++++++++++++++++----------------------------- 1 file changed, 82 insertions(+), 121 deletions(-) (limited to 'src/webex/pages/tip.tsx') diff --git a/src/webex/pages/tip.tsx b/src/webex/pages/tip.tsx index c13120c43..a3f5c38c3 100644 --- a/src/webex/pages/tip.tsx +++ b/src/webex/pages/tip.tsx @@ -14,7 +14,6 @@ TALER; see the file COPYING. If not, see */ - /** * Page shown to the user to confirm creation * of a reserve, usually requested by the bank. @@ -28,152 +27,114 @@ import URI = require("urijs"); import * as i18n from "../../i18n"; -import { - acceptTip, - getReserveCreationInfo, - getTipStatus, -} from "../wxApi"; +import { acceptTip, getReserveCreationInfo, getTipStatus } from "../wxApi"; -import { - WithdrawDetailView, - renderAmount, -} from "../renderHtml"; +import { WithdrawDetailView, renderAmount } from "../renderHtml"; import * as Amounts from "../../amounts"; -import { TipToken } from "../../talerTypes"; -import { ReserveCreationInfo, TipStatus } from "../../walletTypes"; +import { useState, useEffect } from "react"; +import { TipStatus } from "../../walletTypes"; -interface TipDisplayProps { - tipToken: TipToken; +interface LoadingButtonProps { + loading: boolean; } -interface TipDisplayState { - tipStatus?: TipStatus; - rci?: ReserveCreationInfo; - working: boolean; - discarded: boolean; +function LoadingButton( + props: + & React.PropsWithChildren + & React.DetailedHTMLProps< + React.ButtonHTMLAttributes, + HTMLButtonElement + >, +) { + return ( +