From 93ad3534f66e981ecd43e1bb8a6b9f22faba1fe0 Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Thu, 31 Aug 2017 11:20:15 -0400 Subject: [PATCH 01/17] BEM-ified the lastest-blocks and latest-transactions components --- app/src/app/app.scss | 22 +++++++++++++++++++ .../latest-blocks/latest-blocks.html | 10 +++++---- .../latest-blocks/latest-blocks.scss | 21 ------------------ .../latest-transactions.html | 6 ++--- .../latest-transactions.scss | 21 ------------------ 5 files changed, 31 insertions(+), 49 deletions(-) diff --git a/app/src/app/app.scss b/app/src/app/app.scss index e254df4..525e8c5 100644 --- a/app/src/app/app.scss +++ b/app/src/app/app.scss @@ -29,6 +29,28 @@ body { user-select: text; } +.grid--table { + margin: 10px 0 20px; + + .grid--table__row { + border-top: 1px solid #ccc; + + &:first-child { + background-color: white; + border-top: none; + } + + &:nth-child(even) { + background-color: #f4f4f4; + } + + &:last-child { + background-color: white; + } + } +} + + // Shared Sass variables, which can be used to adjust Ionic's // default Sass variables, belong in "theme/variables.scss". // diff --git a/app/src/components/latest-blocks/latest-blocks.html b/app/src/components/latest-blocks/latest-blocks.html index 8268be4..26c6a30 100644 --- a/app/src/components/latest-blocks/latest-blocks.html +++ b/app/src/components/latest-blocks/latest-blocks.html @@ -5,9 +5,9 @@
- + - + Height Age Timestamp @@ -15,7 +15,8 @@ Mined By Size - + + {{block.height}} @@ -35,7 +36,8 @@ {{ block.size }} - + + diff --git a/app/src/components/latest-blocks/latest-blocks.scss b/app/src/components/latest-blocks/latest-blocks.scss index 0ae897d..e03ff64 100644 --- a/app/src/components/latest-blocks/latest-blocks.scss +++ b/app/src/components/latest-blocks/latest-blocks.scss @@ -1,23 +1,2 @@ latest-blocks { - ion-grid { - // border: 2px solid green; - margin: 10px 0 20px; - - ion-row { - border-top: 1px solid #ccc; - } - - ion-row:nth-child(even) { - background-color: #f4f4f4; - } - - ion-row:first-child { - background-color: white; - border-top: none; - } - - ion-row:last-child { - background-color: white; - } - } } diff --git a/app/src/components/latest-transactions/latest-transactions.html b/app/src/components/latest-transactions/latest-transactions.html index 55e5084..d1f13ac 100644 --- a/app/src/components/latest-transactions/latest-transactions.html +++ b/app/src/components/latest-transactions/latest-transactions.html @@ -4,14 +4,14 @@
- + - + Hash Value Out - +
{{ tx.txid }} diff --git a/app/src/components/latest-transactions/latest-transactions.scss b/app/src/components/latest-transactions/latest-transactions.scss index 1b68322..4b8b617 100644 --- a/app/src/components/latest-transactions/latest-transactions.scss +++ b/app/src/components/latest-transactions/latest-transactions.scss @@ -1,23 +1,2 @@ latest-transactions { - ion-grid { - // border: 2px solid green; - margin: 10px 0 20px; - - ion-row { - border-top: 1px solid #ccc; - } - - ion-row:nth-child(even) { - background-color: #f4f4f4; - } - - ion-row:first-child { - background-color: white; - border-top: none; - } - - ion-row:last-child { - background-color: white; - } - } } From 309181032026ec99dea8b76e132124d9077e9e41 Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Thu, 31 Aug 2017 12:40:01 -0400 Subject: [PATCH 02/17] more BEM-ification --- app/src/app/app.scss | 26 ++++++++++--------- .../latest-blocks/latest-blocks.html | 6 ++--- .../latest-transactions.html | 4 +-- app/src/pages/address/address.html | 2 +- app/src/pages/block-detail/block-detail.html | 2 +- app/src/pages/transaction/transaction.html | 2 +- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/app/src/app/app.scss b/app/src/app/app.scss index 525e8c5..806571a 100644 --- a/app/src/app/app.scss +++ b/app/src/app/app.scss @@ -8,6 +8,10 @@ // Additionally, this file can be also used as an entry point // to import other Sass files to be included in the output CSS. +body { + user-select: text; +} + .ellipsis { display: block; overflow: hidden; @@ -15,24 +19,22 @@ white-space: nowrap; } -.summary ion-label { - color: #333; - font-weight: bold; -} +.list--summary { + ion-label { + color: #333; + font-weight: bold; + } -.summary ion-item { - color: #999; - font-size: 1.4rem; -} - -body { - user-select: text; + ion-item { + color: #999; + font-size: 1.4rem; + } } .grid--table { margin: 10px 0 20px; - .grid--table__row { + ion-row { border-top: 1px solid #ccc; &:first-child { diff --git a/app/src/components/latest-blocks/latest-blocks.html b/app/src/components/latest-blocks/latest-blocks.html index 26c6a30..30b2c4b 100644 --- a/app/src/components/latest-blocks/latest-blocks.html +++ b/app/src/components/latest-blocks/latest-blocks.html @@ -7,7 +7,7 @@
- + Height Age Timestamp @@ -16,7 +16,7 @@ Size - + {{block.height}} @@ -37,7 +37,7 @@ - + diff --git a/app/src/components/latest-transactions/latest-transactions.html b/app/src/components/latest-transactions/latest-transactions.html index d1f13ac..63f7aea 100644 --- a/app/src/components/latest-transactions/latest-transactions.html +++ b/app/src/components/latest-transactions/latest-transactions.html @@ -6,12 +6,12 @@
- + Hash Value Out - +
{{ tx.txid }} diff --git a/app/src/pages/address/address.html b/app/src/pages/address/address.html index 4dfc4d7..7907e6a 100644 --- a/app/src/pages/address/address.html +++ b/app/src/pages/address/address.html @@ -14,7 +14,7 @@

Summary

- + Total Received diff --git a/app/src/pages/block-detail/block-detail.html b/app/src/pages/block-detail/block-detail.html index aaebe36..6979840 100644 --- a/app/src/pages/block-detail/block-detail.html +++ b/app/src/pages/block-detail/block-detail.html @@ -13,7 +13,7 @@

Summary

- + Number of Transactions diff --git a/app/src/pages/transaction/transaction.html b/app/src/pages/transaction/transaction.html index 7f904dc..6e7e42c 100644 --- a/app/src/pages/transaction/transaction.html +++ b/app/src/pages/transaction/transaction.html @@ -13,7 +13,7 @@

Summary

- + Size From dd99426add2f61cc28ae536ac6890186eb2e3b12 Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Thu, 31 Aug 2017 12:54:44 -0400 Subject: [PATCH 03/17] minor styling changes on transaction component --- app/src/components/transaction/transaction.scss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/components/transaction/transaction.scss b/app/src/components/transaction/transaction.scss index 40a22fb..efecd52 100644 --- a/app/src/components/transaction/transaction.scss +++ b/app/src/components/transaction/transaction.scss @@ -11,4 +11,12 @@ transaction { border: 1px solid #eee; } } + + .item, .item p { + font-size: 1.4rem; + } + + .list { + margin-bottom: 5px + } } From 2ae129fd94f91845585b0b56026763c3b369be17 Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Tue, 5 Sep 2017 17:22:53 -0400 Subject: [PATCH 04/17] styled the fee and confirmation row in the grid of the transaction component --- app/src/components/transaction/transaction.html | 16 ++++++++-------- app/src/components/transaction/transaction.scss | 4 ++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/src/components/transaction/transaction.html b/app/src/components/transaction/transaction.html index 78b2ea6..724c379 100644 --- a/app/src/components/transaction/transaction.html +++ b/app/src/components/transaction/transaction.html @@ -85,15 +85,15 @@ - - - Fee {{ currency.getConversion(tx.fees) }} + + +
+ Fee {{ currency.getConversion(tx.fees) }} +
- - {{ tx.confirmations }} Confirmations - - - {{ currency.getConversion(tx.valueOut) }} + + {{ tx.confirmations }} Confirmations + {{ currency.getConversion(tx.valueOut) }}
diff --git a/app/src/components/transaction/transaction.scss b/app/src/components/transaction/transaction.scss index efecd52..af682a0 100644 --- a/app/src/components/transaction/transaction.scss +++ b/app/src/components/transaction/transaction.scss @@ -9,6 +9,10 @@ transaction { ion-row { border: 1px solid #eee; + + &.small { + font-size: 1.1rem; + } } } From f0dbd5b5d69791babe9d746a4c755196d041374d Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Mon, 25 Sep 2017 11:10:28 -0400 Subject: [PATCH 05/17] used semantic ion-note tag for block data fields; fixed spacing of merkle root field --- app/src/app/app.scss | 8 +++ app/src/pages/block-detail/block-detail.html | 52 ++++++++++---------- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/app/src/app/app.scss b/app/src/app/app.scss index 806571a..7528722 100644 --- a/app/src/app/app.scss +++ b/app/src/app/app.scss @@ -29,6 +29,14 @@ body { color: #999; font-size: 1.4rem; } + + ion-note { + color: #999; + max-width: 50%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } } .grid--table { diff --git a/app/src/pages/block-detail/block-detail.html b/app/src/pages/block-detail/block-detail.html index 6979840..0103df0 100644 --- a/app/src/pages/block-detail/block-detail.html +++ b/app/src/pages/block-detail/block-detail.html @@ -16,81 +16,81 @@ Number of Transactions - + {{ block.tx.length }} - + Height - + {{ block.height }} (Mainchain) - + Block Reward - + {{ currency.getConversion(block.reward) }} - + Timestamp - + {{ block.time * 1000 | date:'medium' }} - + Mined by - + {{ block.poolInfo.poolName }} - + Merkle Root - + {{ block.merkleroot }} - + Previous Block - + {{ block.height - 1 }} - + Difficulty - + {{ block.difficulty }} - + Bits - + {{ block.bits }} - + Size (bytes) - + {{ block.size }} - + Version - + {{ block.version }} - + Nonce - + {{ block.nonce }} - + Next Block - + {{ block.height + 1 }} - + From 1efdaca2e802200f0d87cfa4ea46284f25c3ecc5 Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Mon, 25 Sep 2017 14:13:38 -0400 Subject: [PATCH 06/17] moved search call to form ngSubmit event --- app/src/components/head-nav/head-nav.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/components/head-nav/head-nav.html b/app/src/components/head-nav/head-nav.html index 1d5ff08..75634ad 100644 --- a/app/src/components/head-nav/head-nav.html +++ b/app/src/components/head-nav/head-nav.html @@ -12,4 +12,6 @@ - +
+ +
From e74ca5ee572d7ea0740b7cdfffa778ea48e3321d Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Tue, 26 Sep 2017 13:02:41 -0400 Subject: [PATCH 07/17] replaced spans with ion-notes; changed font size of ion-items --- app/src/app/app.scss | 2 +- app/src/pages/address/address.html | 16 ++++++++-------- app/src/pages/transaction/transaction.html | 16 ++++++++-------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/src/app/app.scss b/app/src/app/app.scss index 7528722..28da551 100644 --- a/app/src/app/app.scss +++ b/app/src/app/app.scss @@ -27,7 +27,7 @@ body { ion-item { color: #999; - font-size: 1.4rem; + font-size: 1.125rem; } ion-note { diff --git a/app/src/pages/address/address.html b/app/src/pages/address/address.html index 7907e6a..d05fbe3 100644 --- a/app/src/pages/address/address.html +++ b/app/src/pages/address/address.html @@ -17,27 +17,27 @@ Total Received - + {{ currency.getConversion(address.totalReceived) }} - + Total Sent - + {{ currency.getConversion(address.totalSent) }} - + Final Balance - + {{ currency.getConversion(address.balance) }} - + No. Transactions - + {{ address.txApperances }} - + diff --git a/app/src/pages/transaction/transaction.html b/app/src/pages/transaction/transaction.html index 6e7e42c..9b922cc 100644 --- a/app/src/pages/transaction/transaction.html +++ b/app/src/pages/transaction/transaction.html @@ -16,27 +16,27 @@ Size - + {{ tx.size }} (bytes) - + Received Time - + {{ tx.time * 1000 | date:'medium' }} - + Mined Time - + {{ tx.blocktime * 1000 | date:'medium' }} - + Included in Block - + {{ tx.blockhash }} - + From 1fefd25a875577cc64d25ccaf52da7902fce92d6 Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Tue, 26 Sep 2017 16:28:31 -0400 Subject: [PATCH 08/17] minor code formatting/whitespace --- app/src/components/head-nav/head-nav.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/components/head-nav/head-nav.html b/app/src/components/head-nav/head-nav.html index 75634ad..e15d519 100644 --- a/app/src/components/head-nav/head-nav.html +++ b/app/src/components/head-nav/head-nav.html @@ -12,6 +12,7 @@ +
- +
From 26571f0f43841d74d14b480aa0a05c7ebfc21af0 Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Mon, 2 Oct 2017 16:18:53 -0400 Subject: [PATCH 09/17] fixed datetime format and font size on transaction component --- app/package.json | 2 +- app/src/components/transaction/transaction.html | 14 +++++++------- app/src/components/transaction/transaction.scss | 6 ++++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/package.json b/app/package.json index 00d8da9..b4cc2ae 100644 --- a/app/package.json +++ b/app/package.json @@ -41,7 +41,7 @@ "@types/jasmine": "2.5.41", "@types/node": "7.0.4", "codecov": "2.2.0", - "ionic": "3.9.2", + "ionic": "3.12.0", "jasmine-core": "2.5.2", "jasmine-spec-reporter": "3.2.0", "karma": "1.4.1", diff --git a/app/src/components/transaction/transaction.html b/app/src/components/transaction/transaction.html index 724c379..5670b35 100644 --- a/app/src/components/transaction/transaction.html +++ b/app/src/components/transaction/transaction.html @@ -1,19 +1,19 @@ - + - -
+ + first seen at -
-
+ + mined - -
+ +
diff --git a/app/src/components/transaction/transaction.scss b/app/src/components/transaction/transaction.scss index af682a0..631a436 100644 --- a/app/src/components/transaction/transaction.scss +++ b/app/src/components/transaction/transaction.scss @@ -13,6 +13,12 @@ transaction { &.small { font-size: 1.1rem; } + + ion-col { + ion-note { + font-size: 1.2rem; + } + } } } From c02dd53fc5f25bf5f090424d845f4a5c0ca54371 Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Thu, 25 Jan 2018 14:31:29 -0500 Subject: [PATCH 10/17] replaced hard-coded BTC strings in currency selector to allow for other default currencies (ie. BCH); updated ionic version --- app/package.json | 2 +- app/src/components/head-nav/head-nav.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/package.json b/app/package.json index b4cc2ae..c7c22d2 100644 --- a/app/package.json +++ b/app/package.json @@ -41,7 +41,7 @@ "@types/jasmine": "2.5.41", "@types/node": "7.0.4", "codecov": "2.2.0", - "ionic": "3.12.0", + "ionic": "3.19.1", "jasmine-core": "2.5.2", "jasmine-spec-reporter": "3.2.0", "karma": "1.4.1", diff --git a/app/src/components/head-nav/head-nav.ts b/app/src/components/head-nav/head-nav.ts index 664e77e..7e439ec 100644 --- a/app/src/components/head-nav/head-nav.ts +++ b/app/src/components/head-nav/head-nav.ts @@ -113,15 +113,15 @@ export class HeadNavComponent { } }, { - text: 'BTC', + text: this.currency.defaultCurrency, handler: () => { - this.currency.setCurrency('BTC'); + this.currency.setCurrency(this.currency.defaultCurrency); } }, { - text: 'mBTC', + text: 'm' + this.currency.defaultCurrency, handler: () => { - this.currency.setCurrency('mBTC'); + this.currency.setCurrency('m' + this.currency.defaultCurrency); } }, { From c83e16f98ef3cde8f321afc9d55ffb16be58f912 Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Fri, 26 Jan 2018 16:22:49 -0500 Subject: [PATCH 11/17] Fixed denomination units with ability to change default currency (ie. BTC to BCH); Fixed bug with obtaining exchange rate (for BCH); Added number pipe on transactions component --- app/ionic.config.json | 2 +- .../components/transaction/transaction.html | 8 ++-- app/src/providers/currency/currency.ts | 37 +++++++++++++++++-- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/app/ionic.config.json b/app/ionic.config.json index 6f01a59..9ffab3a 100644 --- a/app/ionic.config.json +++ b/app/ionic.config.json @@ -7,6 +7,6 @@ }, "proxies": [{ "path": "/api", - "proxyUrl": "http://localhost:3000/api" + "proxyUrl": "https://bch-insight.bitpay.com/api" }] } diff --git a/app/src/components/transaction/transaction.html b/app/src/components/transaction/transaction.html index 5670b35..cc3528f 100644 --- a/app/src/components/transaction/transaction.html +++ b/app/src/components/transaction/transaction.html @@ -48,7 +48,7 @@
- {{ currency.getConversion(vin.value) }} + {{ currency.getConvertedNumber(vin.value) | number:'1.0-8' }} {{ currency.currencySymbol }}
@@ -76,7 +76,7 @@
- {{ currency.getConversion(vout.value) }} + {{ currency.getConvertedNumber(vout.value) | number:'1.0-8' }} {{ currency.currencySymbol }} (S) (U)
@@ -88,12 +88,12 @@
- Fee {{ currency.getConversion(tx.fees) }} + Fee {{ currency.getConvertedNumber(tx.fees) | number:'1.0-8' }} {{ currency.currencySymbol }}
{{ tx.confirmations }} Confirmations - {{ currency.getConversion(tx.valueOut) }} + {{ currency.getConvertedNumber(tx.valueOut) | number:'1.0-8' }} {{ currency.currencySymbol }}
diff --git a/app/src/providers/currency/currency.ts b/app/src/providers/currency/currency.ts index b3f571b..297392d 100644 --- a/app/src/providers/currency/currency.ts +++ b/app/src/providers/currency/currency.ts @@ -16,6 +16,7 @@ export class CurrencyProvider { public currencySymbol: string; public factor: number = 1; private bitstamp: number; + private kraken: number; private loading: boolean; constructor(public http: Http, private api: ApiProvider) { @@ -27,6 +28,30 @@ export class CurrencyProvider { return Math.round(aFloat * Math.pow(10, decimalPlaces)) / Math.pow(10, decimalPlaces); } + public getConvertedNumber(value: number): number { + if (value === 0.00000000) return 0; + + let response: number; + + if (this.currencySymbol === 'USD') { + response = this.roundFloat((value * this.factor), 2); + } else if (this.currencySymbol === 'm' + this.defaultCurrency) { + this.factor = 1000; + response = this.roundFloat((value * this.factor), 5); + } else if (this.currencySymbol === 'bits') { + this.factor = 1000000; + response = this.roundFloat((value * this.factor), 2); + } else { + this.factor = 1; + response = this.roundFloat((value * this.factor), 8); + } + + return response; + } + + /** + * @deprecated use getConvertedNumber + */ public getConversion(value: number): string { if (value === 0.00000000) return '0 ' + this.currencySymbol; // fix value to show @@ -34,13 +59,13 @@ export class CurrencyProvider { if (this.currencySymbol === 'USD') { response = this.roundFloat((value * this.factor), 2); - } else if (this.currencySymbol === 'mBTC') { + } else if (this.currencySymbol === 'm' + this.defaultCurrency) { this.factor = 1000; response = this.roundFloat((value * this.factor), 5); } else if (this.currencySymbol === 'bits') { this.factor = 1000000; response = this.roundFloat((value * this.factor), 2); - } else { // assumes currencySymbol is BTC + } else { this.factor = 1; response = this.roundFloat((value * this.factor), 8); } @@ -56,7 +81,11 @@ export class CurrencyProvider { this.http.get(this.api.apiPrefix + 'currency').subscribe( (data) => { let currencyParsed: any = JSON.parse(data['_body']); - this.factor = this.bitstamp = currencyParsed.data.bitstamp; + if (currencyParsed.data.bitstamp) { + this.factor = this.bitstamp = currencyParsed.data.bitstamp; + } else if (currencyParsed.data.kraken) { + this.factor = this.kraken = currencyParsed.data.kraken; + } this.loading = false; }, (err) => { @@ -64,7 +93,7 @@ export class CurrencyProvider { this.loading = false; } ); - } else if (currency === 'mBTC') { + } else if (currency === 'm' + this.defaultCurrency) { this.factor = 1000; } else if (currency === 'bits') { this.factor = 1000000; From bcf5c5412130eede6aac031342e03c5ae636fda2 Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Fri, 26 Jan 2018 16:28:46 -0500 Subject: [PATCH 12/17] change proxyUrl back to local --- app/ionic.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ionic.config.json b/app/ionic.config.json index 9ffab3a..6f01a59 100644 --- a/app/ionic.config.json +++ b/app/ionic.config.json @@ -7,6 +7,6 @@ }, "proxies": [{ "path": "/api", - "proxyUrl": "https://bch-insight.bitpay.com/api" + "proxyUrl": "http://localhost:3000/api" }] } From 66e8cbc9115f29b51172a0c8eec08df4f83fcf3a Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Tue, 30 Jan 2018 16:01:31 -0500 Subject: [PATCH 13/17] replace actionsheet with popover --- app/ionic.config.json | 2 +- .../components/denomination/denomination.html | 4 ++++ .../denomination/denomination.module.ts | 19 ++++++++++++++++ .../components/denomination/denomination.scss | 3 +++ .../components/denomination/denomination.ts | 22 +++++++++++++++++++ app/src/components/head-nav/head-nav.html | 2 +- .../components/head-nav/head-nav.module.ts | 4 +++- app/src/components/head-nav/head-nav.ts | 20 +++++++++++++++-- app/src/pages/home/home.html | 4 +++- app/src/providers/currency/currency.ts | 2 +- 10 files changed, 75 insertions(+), 7 deletions(-) create mode 100644 app/src/components/denomination/denomination.html create mode 100644 app/src/components/denomination/denomination.module.ts create mode 100644 app/src/components/denomination/denomination.scss create mode 100644 app/src/components/denomination/denomination.ts diff --git a/app/ionic.config.json b/app/ionic.config.json index 6f01a59..9ffab3a 100644 --- a/app/ionic.config.json +++ b/app/ionic.config.json @@ -7,6 +7,6 @@ }, "proxies": [{ "path": "/api", - "proxyUrl": "http://localhost:3000/api" + "proxyUrl": "https://bch-insight.bitpay.com/api" }] } diff --git a/app/src/components/denomination/denomination.html b/app/src/components/denomination/denomination.html new file mode 100644 index 0000000..90d41b6 --- /dev/null +++ b/app/src/components/denomination/denomination.html @@ -0,0 +1,4 @@ + +
+ {{text}} +
diff --git a/app/src/components/denomination/denomination.module.ts b/app/src/components/denomination/denomination.module.ts new file mode 100644 index 0000000..1c9e478 --- /dev/null +++ b/app/src/components/denomination/denomination.module.ts @@ -0,0 +1,19 @@ +import { NgModule } from '@angular/core'; +import { IonicModule } from 'ionic-angular'; +import { DenominationComponent } from './denomination'; + +@NgModule({ + declarations: [ + DenominationComponent + ], + imports: [ + IonicModule + ], + exports: [ + DenominationComponent + ], + entryComponents: [ + DenominationComponent + ] +}) +export class DenominationComponentModule {} diff --git a/app/src/components/denomination/denomination.scss b/app/src/components/denomination/denomination.scss new file mode 100644 index 0000000..742e908 --- /dev/null +++ b/app/src/components/denomination/denomination.scss @@ -0,0 +1,3 @@ +denomination { + +} diff --git a/app/src/components/denomination/denomination.ts b/app/src/components/denomination/denomination.ts new file mode 100644 index 0000000..62a8fcd --- /dev/null +++ b/app/src/components/denomination/denomination.ts @@ -0,0 +1,22 @@ +import { Component } from '@angular/core'; + +/** + * Generated class for the DenominationComponent component. + * + * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html + * for more info on Angular Components. + */ +@Component({ + selector: 'denomination', + templateUrl: 'denomination.html' +}) +export class DenominationComponent { + + public text: string; + + constructor() { + console.log('Hello DenominationComponent Component'); + this.text = 'Hello World'; + } + +} diff --git a/app/src/components/head-nav/head-nav.html b/app/src/components/head-nav/head-nav.html index e15d519..c439265 100644 --- a/app/src/components/head-nav/head-nav.html +++ b/app/src/components/head-nav/head-nav.html @@ -4,7 +4,7 @@ {{title}} -
+

About

insight is an open-source Bitcoin blockchain explorer with complete REST and websocket APIs that can be used for writing web wallets and other apps that need more advanced blockchain queries than provided by bitcoind RPC. Check out the source code.

-

insight is still in development, so be sure to report any bugs and provide feedback for improvement at our github issue tracker.

+

insight is still in development, so be sure to report any bugs and provide feedback for improvement at our github issue tracker.

Powered by diff --git a/app/src/providers/currency/currency.ts b/app/src/providers/currency/currency.ts index 297392d..19062a2 100644 --- a/app/src/providers/currency/currency.ts +++ b/app/src/providers/currency/currency.ts @@ -20,7 +20,7 @@ export class CurrencyProvider { private loading: boolean; constructor(public http: Http, private api: ApiProvider) { - this.defaultCurrency = 'BTC'; + this.defaultCurrency = 'BCH'; this.currencySymbol = this.defaultCurrency; } From b233467c6eea9f43785cba3c00eb281cabff5f92 Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Tue, 30 Jan 2018 17:04:25 -0500 Subject: [PATCH 14/17] completed popover with appropriate denomination units --- .../components/denomination/denomination.html | 14 +++++++--- .../components/denomination/denomination.ts | 26 +++++++++++++------ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/app/src/components/denomination/denomination.html b/app/src/components/denomination/denomination.html index 90d41b6..f1a00fe 100644 --- a/app/src/components/denomination/denomination.html +++ b/app/src/components/denomination/denomination.html @@ -1,4 +1,10 @@ - -
- {{text}} -
+ + + Units + + + + {{ unit }} + + + diff --git a/app/src/components/denomination/denomination.ts b/app/src/components/denomination/denomination.ts index 62a8fcd..4c80974 100644 --- a/app/src/components/denomination/denomination.ts +++ b/app/src/components/denomination/denomination.ts @@ -1,11 +1,7 @@ import { Component } from '@angular/core'; +import { CurrencyProvider } from '../../providers/currency/currency'; +import { ViewController } from 'ionic-angular'; -/** - * Generated class for the DenominationComponent component. - * - * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html - * for more info on Angular Components. - */ @Component({ selector: 'denomination', templateUrl: 'denomination.html' @@ -13,10 +9,24 @@ import { Component } from '@angular/core'; export class DenominationComponent { public text: string; + public units: any = []; - constructor() { - console.log('Hello DenominationComponent Component'); + constructor( + public currency: CurrencyProvider, + public viewCtrl: ViewController + ) { this.text = 'Hello World'; + this.units = [ + 'USD', + this.currency.defaultCurrency, + 'm' + this.currency.defaultCurrency, + 'bits' + ]; + } + + public close(): void { + console.log('hey, closing'); + this.viewCtrl.dismiss(); } } From d7f2b20ee1cc38855f942f6ed7df29df9c93cdc0 Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Tue, 30 Jan 2018 17:31:24 -0500 Subject: [PATCH 15/17] removed console log --- app/src/components/denomination/denomination.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/components/denomination/denomination.ts b/app/src/components/denomination/denomination.ts index 4c80974..b484472 100644 --- a/app/src/components/denomination/denomination.ts +++ b/app/src/components/denomination/denomination.ts @@ -25,7 +25,6 @@ export class DenominationComponent { } public close(): void { - console.log('hey, closing'); this.viewCtrl.dismiss(); } From a8e604c9cf9aaf7ea5e03a68d27aa0063c456f9f Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Tue, 30 Jan 2018 17:42:45 -0500 Subject: [PATCH 16/17] set currency properly when converting to USD; use number formatting on block detail for block reward --- app/src/components/denomination/denomination.html | 2 +- app/src/pages/block-detail/block-detail.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/components/denomination/denomination.html b/app/src/components/denomination/denomination.html index f1a00fe..65c736b 100644 --- a/app/src/components/denomination/denomination.html +++ b/app/src/components/denomination/denomination.html @@ -1,4 +1,4 @@ - + Units diff --git a/app/src/pages/block-detail/block-detail.html b/app/src/pages/block-detail/block-detail.html index 0103df0..4cc446d 100644 --- a/app/src/pages/block-detail/block-detail.html +++ b/app/src/pages/block-detail/block-detail.html @@ -29,7 +29,7 @@ Block Reward - {{ currency.getConversion(block.reward) }} + {{ currency.getConvertedNumber(block.reward) | number:'1.0-8' }} {{ currency.currencySymbol }} From 432f920e16aa034b61a8170fd1ca7fdc90b1f398 Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Tue, 30 Jan 2018 17:49:20 -0500 Subject: [PATCH 17/17] changed getConversion to getConvertedNumber on address page --- app/src/pages/address/address.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/pages/address/address.html b/app/src/pages/address/address.html index d05fbe3..071c08e 100644 --- a/app/src/pages/address/address.html +++ b/app/src/pages/address/address.html @@ -10,7 +10,7 @@

Address

Address {{ address.addrStr }}

-

{{ currency.getConversion(address.balance) }}

+

{{ currency.getConvertedNumber(address.balance) | number:'1.0-8' }} {{ currency.currencySymbol }}

Summary

@@ -18,19 +18,19 @@ Total Received - {{ currency.getConversion(address.totalReceived) }} + {{ currency.getConvertedNumber(address.totalReceived) | number:'1.0-8' }} {{ currency.currencySymbol }} Total Sent - {{ currency.getConversion(address.totalSent) }} + {{ currency.getConvertedNumber(address.totalSent) | number:'1.0-8' }} {{ currency.currencySymbol }} Final Balance - {{ currency.getConversion(address.balance) }} + {{ currency.getConvertedNumber(address.balance) | number:'1.0-8' }} {{ currency.currencySymbol }}