aboutsummaryrefslogtreecommitdiff
path: root/src/webex/pages/tip.tsx
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-04-06 21:05:51 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-04-06 21:05:51 +0530
commit07f25566ca51b7faf6462a57d15f4ebbfc733ab0 (patch)
tree04e03d831adae4c00ac6a6a19706de4ed6ad7dd3 /src/webex/pages/tip.tsx
parent13bccc7bd982da58738dfd63a2493e476d596161 (diff)
downloadwallet-core-07f25566ca51b7faf6462a57d15f4ebbfc733ab0.tar.xz
start spring cleaning, use rollup instead of both webpack and rollup
Diffstat (limited to 'src/webex/pages/tip.tsx')
-rw-r--r--src/webex/pages/tip.tsx18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/webex/pages/tip.tsx b/src/webex/pages/tip.tsx
index 35e033c0d..10e12d590 100644
--- a/src/webex/pages/tip.tsx
+++ b/src/webex/pages/tip.tsx
@@ -100,26 +100,12 @@ function TipDisplay(props: { talerTipUri: string }) {
);
}
-async function main() {
- try {
+export function createTipPage() {
const url = new URL(document.location.href);
const talerTipUri = url.searchParams.get("talerTipUri");
if (typeof talerTipUri !== "string") {
throw Error("talerTipUri must be a string");
}
- ReactDOM.render(
- <TipDisplay talerTipUri={talerTipUri} />,
- document.getElementById("container")!,
- );
- } catch (e) {
- // TODO: provide more context information, maybe factor it out into a
- // TODO:generic error reporting function or component.
- document.body.innerText = i18n.str`Fatal error: "${e.message}".`;
- console.error(`got error "${e.message}"`, e);
- }
+ return <TipDisplay talerTipUri={talerTipUri} />;
}
-
-document.addEventListener("DOMContentLoaded", () => {
- main();
-});