summaryrefslogtreecommitdiff
path: root/packages/backend/src/pages/ShowOrderDetails.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2021-08-27 15:41:41 -0300
committerSebastian <sebasjm@gmail.com>2021-08-27 15:41:41 -0300
commitd8750f7a066cd047ff9f71c13f67a3f8b012bc62 (patch)
treeac49f01a9f4adc9e7bc56f7c19228516543b698b /packages/backend/src/pages/ShowOrderDetails.tsx
parenteae88828683ec05d438dd4908d86b73e67e9707d (diff)
downloadmerchant-backoffice-d8750f7a066cd047ff9f71c13f67a3f8b012bc62.tar.gz
merchant-backoffice-d8750f7a066cd047ff9f71c13f67a3f8b012bc62.tar.bz2
merchant-backoffice-d8750f7a066cd047ff9f71c13f67a3f8b012bc62.zip
built time rendering
Diffstat (limited to 'packages/backend/src/pages/ShowOrderDetails.tsx')
-rw-r--r--packages/backend/src/pages/ShowOrderDetails.tsx13
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/backend/src/pages/ShowOrderDetails.tsx b/packages/backend/src/pages/ShowOrderDetails.tsx
index 4aae556..591b7ea 100644
--- a/packages/backend/src/pages/ShowOrderDetails.tsx
+++ b/packages/backend/src/pages/ShowOrderDetails.tsx
@@ -20,6 +20,7 @@
*/
import { Fragment, render, h, VNode } from 'preact';
import { useEffect } from 'preact/hooks';
+import { render as renderToString } from 'preact-render-to-string';
export function ShowOrderDetails(): VNode {
useEffect(() => {
@@ -87,13 +88,13 @@ export function ShowOrderDetails(): VNode {
<h1>Order details</h1>
<div>
- This is the default status page for your order for <b>{`{ order_summary }`}</b>.
+ This is the default status page for your order for <b>{`{{ order_summary }}`}</b>.
</div>
<h2>Refund status</h2>
<div>
- The merchant has granted you refunds on the purchase of <b>{`{ refund_amount }`}</b>.
+ The merchant has granted you refunds on the purchase of <b>{`{{ refund_amount }}`}</b>.
</div>
<h2>Full contract details</h2>
@@ -111,15 +112,19 @@ function Title(): VNode {
return <title>Status of your order for {`{order_summary}`}</title>
}
-export function mountIntoBody(): void {
+export function mount(): void {
try {
const params = new URL(window.location.href).searchParams
render(<ShowOrderDetails
- // taler_refund_uri={params.get('taler_refund_uri') || undefined}
+ // taler_refund_uri={params.get('taler_refund_uri') || undefined}
/>, document.body);
+
} catch (e) {
console.error("got error", e);
document.body.innerText = `Fatal error: "${e.message}". Please report this bug at https://bugs.gnunet.org/.`;
}
}
+export function buildTimeRendering(): string {
+ return renderToString(<ShowOrderDetails />)
+}