1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 18:53:29 +00:00

account credit/balance

This commit is contained in:
Kyle Spearrin
2019-02-18 17:34:57 -05:00
parent 8305b49046
commit e45c988637
4 changed files with 24 additions and 2 deletions

View File

@@ -8,7 +8,9 @@
</div>
<i class="fa fa-spinner fa-spin text-muted" *ngIf="!firstLoaded && loading" title="{{'loading' | i18n}}"></i>
<ng-container *ngIf="billing">
<h2>{{'paymentMethod' | i18n}}</h2>
<h2>{{(isCreditBalance ? 'accountCredit' : 'accountBalance') | i18n}}</h2>
<p>{{creditOrBalance | currency:'$'}}</p>
<h2 class="spaced-header">{{'paymentMethod' | i18n}}</h2>
<p *ngIf="!paymentSource">{{'noPaymentMethod' | i18n}}</p>
<ng-container *ngIf="paymentSource">
<app-callout type="warning" title="{{'verifyBankAccount' | i18n}}"

View File

@@ -81,6 +81,14 @@ export class UserBillingComponent implements OnInit {
}
}
get isCreditBalance() {
return this.billing == null || this.billing.balance <= 0;
}
get creditOrBalance() {
return Math.abs(this.billing != null ? this.billing.balance : 0);
}
get paymentSource() {
return this.billing != null ? this.billing.paymentSource : null;
}