mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +00:00
move premium page to jslib
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: df9074a0e5...95cd9153c9
@@ -1,7 +1,4 @@
|
|||||||
import {
|
import { Component } from '@angular/core';
|
||||||
Component,
|
|
||||||
OnInit,
|
|
||||||
} from '@angular/core';
|
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
import { Angulartics2 } from 'angulartics2';
|
||||||
@@ -11,47 +8,16 @@ import { I18nService } from 'jslib/abstractions/i18n.service';
|
|||||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||||
import { TokenService } from 'jslib/abstractions/token.service';
|
import { TokenService } from 'jslib/abstractions/token.service';
|
||||||
|
|
||||||
|
import { PremiumComponent as BasePremiumComponent } from 'jslib/angular/components/premium.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-premium',
|
selector: 'app-premium',
|
||||||
templateUrl: 'premium.component.html',
|
templateUrl: 'premium.component.html',
|
||||||
})
|
})
|
||||||
export class PremiumComponent implements OnInit {
|
export class PremiumComponent extends BasePremiumComponent {
|
||||||
isPremium: boolean = false;
|
constructor(analytics: Angulartics2, toasterService: ToasterService,
|
||||||
price: string = '$10';
|
i18nService: I18nService, platformUtilsService: PlatformUtilsService,
|
||||||
refreshPromise: Promise<any>;
|
tokenService: TokenService, apiService: ApiService) {
|
||||||
|
super(analytics, toasterService, i18nService, platformUtilsService, tokenService, apiService);
|
||||||
constructor(private analytics: Angulartics2, private toasterService: ToasterService,
|
|
||||||
private i18nService: I18nService, private platformUtilsService: PlatformUtilsService,
|
|
||||||
private tokenService: TokenService, private apiService: ApiService) { }
|
|
||||||
|
|
||||||
async ngOnInit() {
|
|
||||||
this.isPremium = this.tokenService.getPremium();
|
|
||||||
}
|
|
||||||
|
|
||||||
async refresh() {
|
|
||||||
try {
|
|
||||||
this.refreshPromise = this.apiService.refreshIdentityToken();
|
|
||||||
await this.refreshPromise;
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('refreshComplete'));
|
|
||||||
this.isPremium = this.tokenService.getPremium();
|
|
||||||
} catch { }
|
|
||||||
}
|
|
||||||
|
|
||||||
async purchase() {
|
|
||||||
const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('premiumPurchaseAlert'),
|
|
||||||
this.i18nService.t('premiumPurchase'), this.i18nService.t('yes'), this.i18nService.t('cancel'));
|
|
||||||
if (confirmed) {
|
|
||||||
this.analytics.eventTrack.next({ action: 'Clicked Purchase Premium' });
|
|
||||||
this.platformUtilsService.launchUri('https://vault.bitwarden.com/#/?premium=purchase');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async manage() {
|
|
||||||
const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('premiumManageAlert'),
|
|
||||||
this.i18nService.t('premiumManage'), this.i18nService.t('yes'), this.i18nService.t('cancel'));
|
|
||||||
if (confirmed) {
|
|
||||||
this.analytics.eventTrack.next({ action: 'Clicked Manage Membership' });
|
|
||||||
this.platformUtilsService.launchUri('https://vault.bitwarden.com/#/?premium=manage');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@import "variables.scss";
|
@import "variables.scss";
|
||||||
|
|
||||||
small {
|
small {
|
||||||
font-size: $font-size-small;
|
font-size: $font-size-small;
|
||||||
|
|||||||
Reference in New Issue
Block a user