aboutsummaryrefslogtreecommitdiff
path: root/src/webex/pages/tip.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/webex/pages/tip.tsx')
-rw-r--r--src/webex/pages/tip.tsx29
1 files changed, 3 insertions, 26 deletions
diff --git a/src/webex/pages/tip.tsx b/src/webex/pages/tip.tsx
index a3f5c38c3..0a066053b 100644
--- a/src/webex/pages/tip.tsx
+++ b/src/webex/pages/tip.tsx
@@ -29,35 +29,12 @@ import * as i18n from "../../i18n";
import { acceptTip, getReserveCreationInfo, getTipStatus } from "../wxApi";
-import { WithdrawDetailView, renderAmount } from "../renderHtml";
+import { WithdrawDetailView, renderAmount, ProgressButton } from "../renderHtml";
import * as Amounts from "../../amounts";
import { useState, useEffect } from "react";
import { TipStatus } from "../../walletTypes";
-interface LoadingButtonProps {
- loading: boolean;
-}
-
-function LoadingButton(
- props:
- & React.PropsWithChildren<LoadingButtonProps>
- & React.DetailedHTMLProps<
- React.ButtonHTMLAttributes<HTMLButtonElement>,
- HTMLButtonElement
- >,
-) {
- return (
- <button
- className="pure-button pure-button-primary"
- type="button"
- {...props}
- >
- {props.loading ? <span><object className="svg-icon svg-baseline" data="/img/spinner-bars.svg" /></span> : null}
- {props.children}
- </button>
- );
-}
function TipDisplay(props: { talerTipUri: string }) {
const [tipStatus, setTipStatus] = useState<TipStatus | undefined>(undefined);
@@ -110,9 +87,9 @@ function TipDisplay(props: { talerTipUri: string }) {
operation.
</p>
<form className="pure-form">
- <LoadingButton loading={loading} onClick={() => accept()}>
+ <ProgressButton loading={loading} onClick={() => accept()}>
AcceptTip
- </LoadingButton>
+ </ProgressButton>
{" "}
<button className="pure-button" type="button" onClick={() => discard()}>
Discard tip