wallet-core/packages/taler-wallet-webextension/src/wallet/ReserveCreated.tsx

68 lines
2.0 KiB
TypeScript
Raw Normal View History

2021-11-15 15:18:58 +01:00
import { h, Fragment, VNode } from "preact";
2021-09-20 19:05:40 +02:00
import { useState } from "preact/hooks";
import { QR } from "../components/QR";
import { ButtonBox, FontIcon, WalletBox } from "../components/styled";
export interface Props {
reservePub: string;
paytos: string[];
onBack: () => void;
}
export function ReserveCreated({ reservePub, paytos, onBack }: Props): VNode {
2021-11-15 15:18:58 +01:00
const [opened, setOpened] = useState(-1);
2021-09-20 19:05:40 +02:00
return (
<WalletBox>
<section>
<h2>Reserve created!</h2>
2021-11-15 15:18:58 +01:00
<p>
Now you need to send money to the exchange to one of the following
accounts
</p>
<p>
To complete the setup of the reserve, you must now initiate a wire
transfer using the given wire transfer subject and crediting the
specified amount to the indicated account of the exchange.
</p>
2021-09-20 19:05:40 +02:00
</section>
<section>
<ul>
{paytos.map((href, idx) => {
2021-11-15 15:18:58 +01:00
const url = new URL(href);
return (
<li key={idx}>
<p>
<a
href=""
onClick={(e) => {
setOpened((o) => (o === idx ? -1 : idx));
e.preventDefault();
}}
>
{url.pathname}
</a>
{opened === idx && (
<Fragment>
<p>
If your system supports RFC 8905, you can do this by
opening <a href={href}>this URI</a> or scan the QR with
your wallet
</p>
<QR text={href} />
</Fragment>
)}
</p>
</li>
);
2021-09-20 19:05:40 +02:00
})}
</ul>
</section>
<footer>
2021-11-15 15:18:58 +01:00
<ButtonBox onClick={onBack}>
<FontIcon>&#x2190;</FontIcon>
</ButtonBox>
2021-09-20 19:05:40 +02:00
<div />
</footer>
</WalletBox>
);
}