Merge pull request #7787 from gabrielbazan7/ref/qrcodemodule

[V4] REF: add new qrcode module to support special characters
This commit is contained in:
Gustavo Maximiliano Cortez 2018-01-09 17:55:45 -03:00 committed by GitHub
commit 8c44446bad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 30 additions and 17 deletions

View File

@ -77,10 +77,10 @@
"@ionic/storage": "^2.1.3",
"@ngx-translate/core": "^8.0.0",
"@nsalaun/ng-logger": "^5.0.0",
"@techiediaries/ngx-qrcode": "0.0.5",
"@types/papaparse": "^4.1.33",
"ajv": "^5.5.2",
"angular2-moment": "^1.7.1",
"angular2-qrcode": "^2.0.1",
"autoprefixer": "^7.2.4",
"bitcore-wallet-client": "^6.4.0",
"buffer-compare": "^1.1.1",

View File

@ -19,7 +19,7 @@ import { FCM } from '@ionic-native/fcm';
/* Modules */
import { MomentModule } from 'angular2-moment';
import { NgLoggerModule, Level } from '@nsalaun/ng-logger';
import { QRCodeModule } from 'angular2-qrcode';
import { NgxQRCodeModule } from '@techiediaries/ngx-qrcode';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslatePoHttpLoader } from '@biesbjerg/ngx-translate-po-http-loader';
@ -396,7 +396,7 @@ export function providersComponents() {
HttpClientModule,
NgLoggerModule.forRoot(Level.LOG),
MomentModule,
QRCodeModule,
NgxQRCodeModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,

View File

@ -15,7 +15,7 @@
</ion-item>
<ion-item>
<div class="qr-code-container" copy-to-clipboard="{{ secret }}">
<qr-code *ngIf="secret" [level]="L" [size]="220" [foreground]="'#334'" [value]="secret"></qr-code>
<ngx-qrcode *ngIf="secret" qrc-value="{{secret}}" qrc-class="aclass" qrc-errorCorrectionLevel="L"></ngx-qrcode>
<div [hidden]="secret" class="spinner">
<ion-spinner></ion-spinner>
</div>
@ -32,19 +32,20 @@
<ion-card-header>
<span translate>Waiting for copayers</span>
<span>
[ <span translate>{{wallet.m}}-of-{{wallet.n}}</span> ]
[
<span translate>{{wallet.m}}-of-{{wallet.n}}</span> ]
</span>
</ion-card-header>
<ion-card-content>
<ion-item *ngFor="let copayer of copayers">
<span [hidden]="copayer.id != wallet.copayerId">
<ion-icon ios="ios-checkmark" md="md-checkmark"></ion-icon>
{{'Me'|translate}}
</span>
<ion-icon ios="ios-checkmark" md="md-checkmark"></ion-icon>
{{'Me'|translate}}
</span>
<span [hidden]="copayer.id == wallet.copayerId">
<ion-icon ios="ios-checkmark" md="md-checkmark"></ion-icon>
{{copayer.name}}
</span>
<ion-icon ios="ios-checkmark" md="md-checkmark"></ion-icon>
{{copayer.name}}
</span>
</ion-item>
<ion-item *ngIf="!wallet.isComplete()">
<ion-icon ios="ios-repeat" md="md-repeat"></ion-icon> {{'Waiting...'|translate}}

View File

@ -9,6 +9,9 @@ page-copayers {
margin-top: 1rem;
margin-bottom: 2rem;
}
.aclass >img {
width: 220px;
}
}
}
.copayers-card {

View File

@ -4,7 +4,7 @@
<ion-title>{{'Custom Amount' | translate}}</ion-title>
<ion-buttons end>
<button *ngIf="showShareButton" ion-button icon-only (click)="shareAddress()" translate>
<ion-icon name="share"></ion-icon>
<ion-icon name="share"></ion-icon>
</button>
</ion-buttons>
</ion-navbar>
@ -12,7 +12,7 @@
</ion-header>
<ion-content>
<div class="qr-container">
<qr-code *ngIf="address" copy-to-clipboard="{{qrAddress}}" [value]="qrAddress" [level]="M" [size]="220" [foreground]="'#334'"></qr-code>
<ngx-qrcode *ngIf="address" copy-to-clipboard="{{ qrAddress }}" qrc-value="{{qrAddress}}" qrc-class="aclass" qrc-errorCorrectionLevel="M"></ngx-qrcode>
</div>
<ion-list>
<ion-item>

View File

@ -3,6 +3,9 @@ page-custom-amount {
padding: 50px;
display: flex;
justify-content: center;
.aclass >img {
width: 220px;
}
}
.wallet-label {
align-items: center;
@ -18,5 +21,5 @@ page-custom-amount {
.address-note{
font-size: 12px;
}
}
}
}

View File

@ -20,7 +20,7 @@
<div *ngIf="loading" class="loading-address spinner">
<ion-spinner></ion-spinner>
</div>
<qr-code *ngIf="!loading && address" copy-to-clipboard="{{ address }}" [value]="qrAddress" [level]="M" [size]="220" [foreground]="'#334'"></qr-code>
<ngx-qrcode *ngIf="!loading && address" copy-to-clipboard="{{ address }}" qrc-value="{{qrAddress}}" qrc-class="aclass" qrc-errorCorrectionLevel="M"></ngx-qrcode>
<div *ngIf="!loading" class="text-address" copy-to-clipboard="{{ address }}">{{ address }}</div>
<div *ngIf="loading" class="text-address">...</div>
<button ion-button block clear [hidden]="!address" (click)="requestSpecificAmount()">
@ -59,4 +59,4 @@
<div>{{wallet.name}}</div>
</div>
</div>
</ion-footer>
</ion-footer>

View File

@ -37,6 +37,9 @@ page-receive {
font-size: 12px;
color: color($colors, secondary);
}
.aclass >img {
width: 220px;
}
}
.wallets-container {
padding-left: 2rem;

View File

@ -71,7 +71,7 @@
</ion-list>
<ion-list *ngSwitchCase="'qrCode'">
<div class="qrCode" *ngIf="supported">
<qr-code [value]="exportWalletInfo" [level]="M" [size]="220" [foreground]="'#334'"></qr-code>
<ngx-qrcode qrc-value="{{exportWalletInfo}}" qrc-class="aclass" qrc-errorCorrectionLevel="M"></ngx-qrcode>
<div translate>From the destination device, go to Add wallet &gt; Import wallet and scan this QR code</div>
</div>
<ion-card class="not-supported-message" *ngIf="!supported">

View File

@ -2,6 +2,9 @@ page-wallet-export {
.qrCode {
text-align: center;
padding: 10px;
.aclass >img {
width: 220px;
}
}
.not-supported-message {
text-align: center;