Add upgrade plan button (#2937)
This commit is contained in:
parent
25deba16df
commit
40b6777814
@ -219,18 +219,18 @@ export class UserService {
|
|||||||
new Date(),
|
new Date(),
|
||||||
user.createdAt
|
user.createdAt
|
||||||
);
|
);
|
||||||
let frequency = 15;
|
let frequency = 10;
|
||||||
|
|
||||||
if (daysSinceRegistration > 365) {
|
if (daysSinceRegistration > 365) {
|
||||||
frequency = 2;
|
frequency = 2;
|
||||||
} else if (daysSinceRegistration > 180) {
|
} else if (daysSinceRegistration > 180) {
|
||||||
frequency = 3;
|
frequency = 3;
|
||||||
} else if (daysSinceRegistration > 60) {
|
} else if (daysSinceRegistration > 60) {
|
||||||
frequency = 5;
|
frequency = 4;
|
||||||
} else if (daysSinceRegistration > 30) {
|
} else if (daysSinceRegistration > 30) {
|
||||||
frequency = 8;
|
frequency = 6;
|
||||||
} else if (daysSinceRegistration > 15) {
|
} else if (daysSinceRegistration > 15) {
|
||||||
frequency = 12;
|
frequency = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Analytics?.activityCount % frequency === 1) {
|
if (Analytics?.activityCount % frequency === 1) {
|
||||||
|
@ -165,6 +165,32 @@
|
|||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
<mat-menu #accountMenu="matMenu" xPosition="before">
|
<mat-menu #accountMenu="matMenu" xPosition="before">
|
||||||
|
<ng-container
|
||||||
|
*ngIf="
|
||||||
|
hasPermissionForSubscription &&
|
||||||
|
user?.subscription?.type === 'Basic'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a class="d-flex" mat-menu-item [routerLink]="routerLinkPricing"
|
||||||
|
><span class="align-items-center d-flex"
|
||||||
|
><span
|
||||||
|
><ng-container
|
||||||
|
*ngIf="user.subscription.offer === 'default'"
|
||||||
|
i18n
|
||||||
|
>Upgrade Plan</ng-container
|
||||||
|
>
|
||||||
|
<ng-container
|
||||||
|
*ngIf="user.subscription.offer === 'renewal'"
|
||||||
|
i18n
|
||||||
|
>Renew Plan</ng-container
|
||||||
|
></span
|
||||||
|
>
|
||||||
|
<gf-premium-indicator
|
||||||
|
class="d-inline-block ml-1"
|
||||||
|
[enableLink]="false" /></span
|
||||||
|
></a>
|
||||||
|
<hr class="m-0" />
|
||||||
|
</ng-container>
|
||||||
<ng-container *ngIf="user?.access?.length > 0">
|
<ng-container *ngIf="user?.access?.length > 0">
|
||||||
<button mat-menu-item (click)="impersonateAccount(null)">
|
<button mat-menu-item (click)="impersonateAccount(null)">
|
||||||
<span class="align-items-center d-flex">
|
<span class="align-items-center d-flex">
|
||||||
|
@ -7,6 +7,7 @@ import { RouterModule } from '@angular/router';
|
|||||||
import { LoginWithAccessTokenDialogModule } from '@ghostfolio/client/components/login-with-access-token-dialog/login-with-access-token-dialog.module';
|
import { LoginWithAccessTokenDialogModule } from '@ghostfolio/client/components/login-with-access-token-dialog/login-with-access-token-dialog.module';
|
||||||
import { GfAssistantModule } from '@ghostfolio/ui/assistant';
|
import { GfAssistantModule } from '@ghostfolio/ui/assistant';
|
||||||
import { GfLogoModule } from '@ghostfolio/ui/logo';
|
import { GfLogoModule } from '@ghostfolio/ui/logo';
|
||||||
|
import { GfPremiumIndicatorModule } from '@ghostfolio/ui/premium-indicator';
|
||||||
|
|
||||||
import { HeaderComponent } from './header.component';
|
import { HeaderComponent } from './header.component';
|
||||||
|
|
||||||
@ -17,6 +18,7 @@ import { HeaderComponent } from './header.component';
|
|||||||
CommonModule,
|
CommonModule,
|
||||||
GfAssistantModule,
|
GfAssistantModule,
|
||||||
GfLogoModule,
|
GfLogoModule,
|
||||||
|
GfPremiumIndicatorModule,
|
||||||
LoginWithAccessTokenDialogModule,
|
LoginWithAccessTokenDialogModule,
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
>
|
>
|
||||||
<button color="primary" mat-flat-button (click)="onCheckout()">
|
<button color="primary" mat-flat-button (click)="onCheckout()">
|
||||||
<ng-container *ngIf="user.subscription.offer === 'default'" i18n
|
<ng-container *ngIf="user.subscription.offer === 'default'" i18n
|
||||||
>Upgrade</ng-container
|
>Upgrade Plan</ng-container
|
||||||
>
|
>
|
||||||
<ng-container *ngIf="user.subscription.offer === 'renewal'" i18n
|
<ng-container *ngIf="user.subscription.offer === 'renewal'" i18n
|
||||||
>Renew</ng-container
|
>Renew Plan</ng-container
|
||||||
>
|
>
|
||||||
</button>
|
</button>
|
||||||
<div *ngIf="price" class="mt-1 text-center">
|
<div *ngIf="price" class="mt-1 text-center">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user