diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-04-06 23:32:01 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-04-06 23:32:01 +0530 |
commit | 47787c0b0b846d5f4a057661efdd05d8786032f1 (patch) | |
tree | 3a3d58a5ebad8af584de6a6cd882c2019f71dffa /src/webex/pages/tip.tsx | |
parent | f36bb7a04eabe0330cb166bf9ce5021c92f38dc8 (diff) | |
download | wallet-core-47787c0b0b846d5f4a057661efdd05d8786032f1.tar.xz |
make linter less grumpy
Diffstat (limited to 'src/webex/pages/tip.tsx')
-rw-r--r-- | src/webex/pages/tip.tsx | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/webex/pages/tip.tsx b/src/webex/pages/tip.tsx index 10e12d590..9c797f50d 100644 --- a/src/webex/pages/tip.tsx +++ b/src/webex/pages/tip.tsx @@ -22,30 +22,25 @@ */ import * as React from "react"; -import * as ReactDOM from "react-dom"; -import * as i18n from "../i18n"; - -import { acceptTip, getReserveCreationInfo, getTipStatus } from "../wxApi"; +import { acceptTip, getTipStatus } from "../wxApi"; import { - WithdrawDetailView, renderAmount, ProgressButton, } from "../renderHtml"; -import * as Amounts from "../../util/amounts"; import { useState, useEffect } from "react"; import { TipStatus } from "../../types/walletTypes"; -function TipDisplay(props: { talerTipUri: string }) { +function TipDisplay(props: { talerTipUri: string }): JSX.Element { const [tipStatus, setTipStatus] = useState<TipStatus | undefined>(undefined); const [discarded, setDiscarded] = useState(false); const [loading, setLoading] = useState(false); const [finished, setFinished] = useState(false); useEffect(() => { - const doFetch = async () => { + const doFetch = async (): Promise<void> => { const ts = await getTipStatus(props.talerTipUri); setTipStatus(ts); }; @@ -53,7 +48,7 @@ function TipDisplay(props: { talerTipUri: string }) { }, []); if (discarded) { - return <span>You've discarded the tip.</span>; + return <span>You've discarded the tip.</span>; } if (finished) { @@ -64,11 +59,11 @@ function TipDisplay(props: { talerTipUri: string }) { return <span>Loading ...</span>; } - const discard = () => { + const discard = (): void => { setDiscarded(true); }; - const accept = async () => { + const accept = async (): Promise<void> => { setLoading(true); await acceptTip(tipStatus.tipId); setFinished(true); @@ -100,7 +95,7 @@ function TipDisplay(props: { talerTipUri: string }) { ); } -export function createTipPage() { +export function createTipPage(): JSX.Element { const url = new URL(document.location.href); const talerTipUri = url.searchParams.get("talerTipUri"); if (typeof talerTipUri !== "string") { |