feat(core): believer subscription UI (#7431)

feat(core): switch ai and cloud plans position

feat(core): impl lifetime subscription ui

feat(core): adapt ui for lifetime status

feat(core): add believer card in billing page
This commit is contained in:
CatsJuice
2024-07-08 08:31:21 +00:00
parent 556956ced2
commit 13a2562282
43 changed files with 1048 additions and 439 deletions
@@ -28,6 +28,12 @@ export class SubscriptionPrices extends Entity {
prices ? prices.find(price => price.plan === 'AI') : null
);
readableLifetimePrice$ = this.proPrice$.map(price =>
price?.lifetimeAmount
? `$${(price.lifetimeAmount / 100).toFixed(2).replace(/\.0+$/, '')}`
: ''
);
constructor(
private readonly serverConfigService: ServerConfigService,
private readonly store: SubscriptionStore
@@ -1,4 +1,4 @@
import type { SubscriptionQuery, SubscriptionRecurring } from '@affine/graphql';
import { type SubscriptionQuery, SubscriptionRecurring } from '@affine/graphql';
import { SubscriptionPlan } from '@affine/graphql';
import {
backoffRetry,
@@ -38,6 +38,9 @@ export class Subscription extends Entity {
? subscriptions.find(sub => sub.plan === SubscriptionPlan.AI)
: null
);
isBeliever$ = this.pro$.map(
sub => sub?.recurring === SubscriptionRecurring.Lifetime
);
constructor(
private readonly authService: AuthService,