replace actionsheet with popover

This commit is contained in:
Darren Nelsen 2018-01-30 16:01:31 -05:00
parent bcf5c54121
commit 66e8cbc911
10 changed files with 75 additions and 7 deletions

View File

@ -7,6 +7,6 @@
}, },
"proxies": [{ "proxies": [{
"path": "/api", "path": "/api",
"proxyUrl": "http://localhost:3000/api" "proxyUrl": "https://bch-insight.bitpay.com/api"
}] }]
} }

View File

@ -0,0 +1,4 @@
<!-- Generated template for the DenominationComponent component -->
<div>
{{text}}
</div>

View File

@ -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 {}

View File

@ -0,0 +1,3 @@
denomination {
}

View File

@ -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';
}
}

View File

@ -4,7 +4,7 @@
</button> </button>
<ion-title>{{title}}</ion-title> <ion-title>{{title}}</ion-title>
<ion-buttons end> <ion-buttons end>
<button ion-button (click)="changeCurrency()"> <button ion-button (click)="changeCurrency($event)">
<ion-icon name="logo-bitcoin" *ngIf="currency.currencySymbol !== 'USD'"></ion-icon><ion-icon name="logo-usd" *ngIf="currency.currencySymbol === 'USD'"></ion-icon>&nbsp;{{ currency.currencySymbol }} <ion-icon name="logo-bitcoin" *ngIf="currency.currencySymbol !== 'USD'"></ion-icon><ion-icon name="logo-usd" *ngIf="currency.currencySymbol === 'USD'"></ion-icon>&nbsp;{{ currency.currencySymbol }}
</button> </button>
<button ion-button icon-only (click)="toggleSearch()"> <button ion-button icon-only (click)="toggleSearch()">

View File

@ -1,13 +1,15 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { IonicModule } from 'ionic-angular'; import { IonicModule } from 'ionic-angular';
import { HeadNavComponent } from './head-nav'; import { HeadNavComponent } from './head-nav';
import { DenominationComponentModule } from '../denomination/denomination.module';
@NgModule({ @NgModule({
declarations: [ declarations: [
HeadNavComponent HeadNavComponent
], ],
imports: [ imports: [
IonicModule IonicModule,
DenominationComponentModule
], ],
exports: [ exports: [
HeadNavComponent HeadNavComponent

View File

@ -5,6 +5,8 @@ import { Http } from '@angular/http';
import { ApiProvider } from '../../providers/api/api'; import { ApiProvider } from '../../providers/api/api';
import { CurrencyProvider } from '../../providers/currency/currency'; import { CurrencyProvider } from '../../providers/currency/currency';
import { ActionSheetController } from 'ionic-angular'; import { ActionSheetController } from 'ionic-angular';
import { PopoverController } from 'ionic-angular';
import { DenominationComponent } from '../denomination/denomination';
/** /**
* Generated class for the HeadNavComponent component. * Generated class for the HeadNavComponent component.
@ -24,7 +26,14 @@ export class HeadNavComponent {
public q: string; public q: string;
public badQuery: boolean = false; public badQuery: boolean = false;
constructor(private navCtrl: NavController, private http: Http, private api: ApiProvider, public currency: CurrencyProvider, public actionSheetCtrl: ActionSheetController) { constructor(
private navCtrl: NavController,
private http: Http,
private api: ApiProvider,
public currency: CurrencyProvider,
public actionSheetCtrl: ActionSheetController,
public popoverCtrl: PopoverController
) {
} }
public search(): void { public search(): void {
@ -102,7 +111,8 @@ export class HeadNavComponent {
} }
/* tslint:enable:no-unused-variable */ /* tslint:enable:no-unused-variable */
public changeCurrency(): void { public changeCurrency(myEvent: any): void {
/*
let actionSheet: any = this.actionSheetCtrl.create({ let actionSheet: any = this.actionSheetCtrl.create({
title: 'Change Denomination', title: 'Change Denomination',
buttons: [ buttons: [
@ -137,6 +147,12 @@ export class HeadNavComponent {
] ]
}); });
actionSheet.present(); actionSheet.present();
*/
let popover: any = this.popoverCtrl.create(DenominationComponent);
popover.present({
ev: myEvent
});
} }
public toggleSearch(): void { public toggleSearch(): void {

View File

@ -16,16 +16,18 @@
<latest-blocks [numBlocks]="6" [showTimeAs]="'age'" [showAllBlocksButton]="true"></latest-blocks> <latest-blocks [numBlocks]="6" [showTimeAs]="'age'" [showAllBlocksButton]="true"></latest-blocks>
</div> </div>
<!--
<div> <div>
<h1>Latest Transactions</h1> <h1>Latest Transactions</h1>
<latest-transactions [refreshSeconds]="8"></latest-transactions> <latest-transactions [refreshSeconds]="8"></latest-transactions>
</div> </div>
-->
<div class="about"> <div class="about">
<h2>About</h2> <h2>About</h2>
<p><strong>insight</strong> is an <a href="https://insight.is/" <p><strong>insight</strong> is an <a href="https://insight.is/"
target="_blank">open-source Bitcoin blockchain explorer</a> 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 <a href="https://github.com/bitpay/insight-ui" target="_blank">source code</a>.</p> target="_blank">open-source Bitcoin blockchain explorer</a> 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 <a href="https://github.com/bitpay/insight-ui" target="_blank">source code</a>.</p>
<p><strong>insight</strong> is still in development, so be sure to report any bugs and provide feedback for improvement at our <a href="https://github.com/bitpay/insight-ui/issues" target="_blank">github issue tracker</a>.</p> <p><strong>insight</strong> is still in development, so be sure to report any bugs and provide feedback for improvement at our <a href="https://github.com/bitpay/insight/issues" target="_blank">github issue tracker</a>.</p>
<div id="powered" class="row"> <div id="powered" class="row">
<div class="powered-text"> <div class="powered-text">
<small class="text-muted">Powered by</small> <small class="text-muted">Powered by</small>

View File

@ -20,7 +20,7 @@ export class CurrencyProvider {
private loading: boolean; private loading: boolean;
constructor(public http: Http, private api: ApiProvider) { constructor(public http: Http, private api: ApiProvider) {
this.defaultCurrency = 'BTC'; this.defaultCurrency = 'BCH';
this.currencySymbol = this.defaultCurrency; this.currencySymbol = this.defaultCurrency;
} }