diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-10-12 23:30:10 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-10-12 23:30:10 +0200 |
commit | 122e069d914622343fa1a21c3990a2f416ea9dfe (patch) | |
tree | a824a5e12509a791cb3c47822fa3a308a0ded360 /pages | |
parent | d4be3906e32ac7d9933c6030d6493f2f2152bdd9 (diff) |
crypto for refreshing
Diffstat (limited to 'pages')
-rw-r--r-- | pages/tree.tsx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pages/tree.tsx b/pages/tree.tsx index acc470216..b1c22b9f8 100644 --- a/pages/tree.tsx +++ b/pages/tree.tsx @@ -84,6 +84,30 @@ interface CoinViewProps { coin: Coin; } +interface RefreshDialogProps { + coin: Coin; +} + +class RefreshDialog extends ImplicitStateComponent<RefreshDialogProps> { + refreshRequested = this.makeState<boolean>(false); + render(): JSX.Element { + if (!this.refreshRequested()) { + return ( + <div style="display:inline;"> + <button onClick={() => this.refreshRequested(true)}>refresh</button> + </div> + ); + } + return ( + <div> + Refresh amount: <input type="text" size={10} /> + <button>ok</button> + <button onClick={() => this.refreshRequested(false)}>cancel</button> + </div> + ); + } +} + class CoinView extends preact.Component<CoinViewProps, void> { render() { let c = this.props.coin; @@ -94,6 +118,7 @@ class CoinView extends preact.Component<CoinViewProps, void> { <li>Current amount: {prettyAmount(c.currentAmount)}</li> <li>Denomination: {abbrev(c.denomPub, 20)}</li> <li>Suspended: {(c.suspended || false).toString()}</li> + <li><RefreshDialog coin={c} /></li> </ul> </div> ); |