From dda90b51f6fc6fca48a68bc53088e1ed3f018a21 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 9 Sep 2022 12:22:26 -0300 Subject: find taler action in clipboard and withdraw with mobile --- .../src/cta/Withdraw/views.tsx | 94 +++++++++++++++------- 1 file changed, 67 insertions(+), 27 deletions(-) (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw/views.tsx') diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/views.tsx b/packages/taler-wallet-webextension/src/cta/Withdraw/views.tsx index 850bd6e8f..440586343 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/views.tsx +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/views.tsx @@ -23,6 +23,7 @@ import { SelectList } from "../../components/SelectList.js"; import { Input, Link, + LinkSuccess, SubTitle, SuccessBox, SvgIcon, @@ -35,6 +36,8 @@ import { TermsOfServiceSection } from "../TermsOfServiceSection.js"; import { State } from "./index.js"; import editIcon from "../../svg/edit_24px.svg"; import { Amount } from "../../components/Amount.js"; +import { QR } from "../../components/QR.js"; +import { useState } from "preact/hooks"; export function LoadingUriView({ error }: State.LoadingUriError): VNode { const { i18n } = useTranslationContext(); @@ -126,13 +129,13 @@ export function SuccessView(state: State.Success): VNode { }} > Exchange - + {/* - + */} } text={} @@ -164,31 +167,36 @@ export function SuccessView(state: State.Success): VNode { {state.tosProps && } {state.tosProps ? ( -
- {(state.tosProps.terms.status === "accepted" || - (state.mustAcceptFirst && state.tosProps.reviewed)) && ( - - )} - {state.tosProps.terms.status === "notfound" && ( - - )} -
+ +
+ {(state.tosProps.terms.status === "accepted" || + (state.mustAcceptFirst && state.tosProps.reviewed)) && ( + + )} + {state.tosProps.terms.status === "notfound" && ( + + )} +
+ {state.talerWithdrawUri ? ( + + ) : undefined} +
) : (
Loading terms of service... @@ -202,3 +210,35 @@ export function SuccessView(state: State.Success): VNode { ); } + +function WithdrawWithMobile({ + talerWithdrawUri, +}: { + talerWithdrawUri: string; +}): VNode { + const { i18n } = useTranslationContext(); + const [showQR, setShowQR] = useState(false); + + return ( +
+ setShowQR((qr) => !qr)}> + {!showQR ? ( + Withdraw to a mobile phone + ) : ( + Hide QR + )} + + {showQR && ( +
+ + + Scan the QR code or   + + click here + + +
+ )} +
+ ); +} -- cgit v1.2.3