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": [{
"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>
<ion-title>{{title}}</ion-title>
<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 }}
</button>
<button ion-button icon-only (click)="toggleSearch()">

View File

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

View File

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

View File

@ -16,16 +16,18 @@
<latest-blocks [numBlocks]="6" [showTimeAs]="'age'" [showAllBlocksButton]="true"></latest-blocks>
</div>
<!--
<div>
<h1>Latest Transactions</h1>
<latest-transactions [refreshSeconds]="8"></latest-transactions>
</div>
-->
<div class="about">
<h2>About</h2>
<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>
<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 class="powered-text">
<small class="text-muted">Powered by</small>

View File

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