From a714961b20296649a5878dcd4080ce824a2ca4ed Mon Sep 17 00:00:00 2001 From: CatsJuice Date: Fri, 26 Jul 2024 02:49:15 +0000 Subject: [PATCH] feat(core): adjust subscription related mixpanel (#7536) --- .../account-setting/ai-usage-panel.tsx | 2 +- .../general-setting/billing/index.tsx | 38 +++++++------- .../general-setting/plans/actions.tsx | 51 ++++++++++++------- .../plans/ai/actions/cancel.tsx | 29 +++++++---- .../plans/ai/actions/resume.tsx | 38 +++++++++----- .../general-setting/plans/ai/ai-plan.tsx | 10 +++- .../general-setting/plans/plan-card.tsx | 39 +++++++------- .../hooks/affine/use-subscription-notify.tsx | 10 ++-- packages/frontend/core/src/mixpanel/index.ts | 7 +++ .../core/src/mixpanel/plan-change-started.ts | 15 ++++++ .../core/src/mixpanel/plan-change-succeed.ts | 9 ++++ .../frontend/core/src/pages/subscribe.tsx | 4 -- packages/frontend/core/src/utils/mixpanel.ts | 9 ++++ 13 files changed, 169 insertions(+), 92 deletions(-) create mode 100644 packages/frontend/core/src/mixpanel/index.ts create mode 100644 packages/frontend/core/src/mixpanel/plan-change-started.ts create mode 100644 packages/frontend/core/src/mixpanel/plan-change-succeed.ts diff --git a/packages/frontend/core/src/components/affine/setting-modal/account-setting/ai-usage-panel.tsx b/packages/frontend/core/src/components/affine/setting-modal/account-setting/ai-usage-panel.tsx index 325aa4217a..f53db45a41 100644 --- a/packages/frontend/core/src/components/affine/setting-modal/account-setting/ai-usage-panel.tsx +++ b/packages/frontend/core/src/components/affine/setting-modal/account-setting/ai-usage-panel.tsx @@ -104,7 +104,7 @@ export const AIUsagePanel = () => { > {copilotActionLimit === 'unlimited' ? ( hasPaymentFeature && aiSubscription?.canceledAt ? ( - + ) : (