Skip to content

Commit 7d6c9f3

Browse files
committed
reorder ui and buy
1 parent 069e1c7 commit 7d6c9f3

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

packages/test-app/src/test-app-app/test-app-app.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,15 @@ class TestAppApp extends PolymerElement {
7575
<paper-icon-button id="statusicon" icon="svg-sample-icons:online-status"></paper-icon-button>
7676
7777
<div main-title>Token Explorer</div>
78-
<paper-icon-button icon="svg-sample-icons:cart" on-tap="_openBuy"></paper-icon-button>
78+
<paper-button raised on-tap="_openBuy">
79+
<iron-icon icon="svg-sample-icons:cart"></iron-icon>
80+
Buy
81+
</paper-button>
7982
<iron-dropdown id="buy" horizontal-align="right" vertical-align="top">
8083
<div slot="dropdown-content">
8184
<h2>Buy</h2>
82-
<paper-input label="Buy [[name]]"></paper-input>
83-
<paper-button label="kaufen" raised>Kaufen</paper-button>
85+
<paper-input id="amount" label="Buy [[name]]" value="10" tab-index="0"></paper-input>
86+
<paper-button on-tap="_purchaseCoin" raised>Buy</paper-button>
8487
</div>
8588
</iron-dropdown>
8689
<paper-icon-button icon="svg-sample-icons:settings" on-tap="_openSettings"></paper-icon-button>
@@ -136,7 +139,6 @@ class TestAppApp extends PolymerElement {
136139
}
137140
ready() {
138141
super.ready();
139-
this._triggerTokenSupply(this.tokens[0]);
140142
installOfflineWatcher((offline) => {
141143

142144
if (offline) {
@@ -145,23 +147,21 @@ class TestAppApp extends PolymerElement {
145147
this.$.statusicon.removeAttribute('disabled');
146148
}
147149
})
150+
this.name = this.tokens[this.selectedToken].name
148151
}
152+
_purchaseCoin() {
149153

154+
this.$.buy.close();
155+
let buyAmount = this.$.amount.value;
156+
console.log(buyAmount);
157+
}
150158
_openSettings() {
151159
this.$.settings.toggle();
152160
}
153161
_openBuy() {
154162
this.$.buy.toggle();
155163
}
156164

157-
_triggerTokenSupply(token) {
158-
var api = etherscanApi.init('');
159-
var supply = api.stats.tokensupply(null, token.address);
160-
supply.then((res)=>{
161-
this.name = token.name;
162-
this.supply = res.result
163-
})
164-
}
165165
_symbolForIndex(index) {
166166
return this.datasetsIcons[index]
167167
}
@@ -179,7 +179,6 @@ class TestAppApp extends PolymerElement {
179179
this._triggerHistory(token);
180180
}
181181
_changeToken(token) {
182-
this._triggerTokenSupply(this.tokens[token])
183182
this._triggerHistory(this.tokens[token]);
184183
}
185184
_triggerHistory(token) {

0 commit comments

Comments
 (0)