diff options
Diffstat (limited to 'pages')
-rw-r--r-- | pages/confirm-contract.tsx | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/pages/confirm-contract.tsx b/pages/confirm-contract.tsx index 9ce1b0a5a..0c7419c6c 100644 --- a/pages/confirm-contract.tsx +++ b/pages/confirm-contract.tsx @@ -21,12 +21,14 @@ * @author Florian Dold */ -/// <reference path="../lib/decl/handlebars/handlebars.d.ts" /> -"use strict"; +/// <reference path="../lib/decl/handlebars/handlebars.d.ts" /> +import MithrilComponent = _mithril.MithrilComponent; import {substituteFulfillmentUrl} from "../lib/wallet/helpers"; +import m from "mithril"; +import {Contract} from "../lib/wallet/types"; +"use strict"; -declare var m: any; function prettyAmount(amount) { let v = amount.value + amount.fraction / 1e6; @@ -34,6 +36,35 @@ function prettyAmount(amount) { } +const Details = { + controller() { + return {collapsed: m.prop(true)}; + }, + view(ctrl, contract: Contract) { + if (ctrl.collapsed()) { + return m("div", [ + m("button.linky", { + onclick: () => { + ctrl.collapsed(false); + } + }, "show more details") + ]); + } else { + return m("div", [ + m("button.linky", { + onclick: () => { + ctrl.collapsed(true); + } + }, "show less details"), + m("div", [ + "Accepted exchanges:", + m("ul", contract.exchanges.map(e => m("li", `${e.url}: ${e.master_pub}`))) + ]) + ]); + } + } +}; + export function main() { let url = URI(document.location.href); let query: any = URI.parseQuery(url.query()); @@ -58,6 +89,7 @@ export function main() { `${p.description}: ${prettyAmount(p.price)}`))), m("button.confirm-pay", {onclick: doPayment}, i18n`Confirm Payment`), m("p", error ? error : []), + m(Details, contract) ]; } }; |