mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 02:56:23 +08:00
feat(core): make event track great again (#7695)
 
This commit is contained in:
+1
-2
@@ -1,7 +1,6 @@
|
||||
import { getDowngradeQuestionnaireLink } from '@affine/core/hooks/affine/use-subscription-notify';
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { mixpanel } from '@affine/core/mixpanel';
|
||||
import type { MixpanelEvents } from '@affine/core/mixpanel/events';
|
||||
import { SubscriptionPlan } from '@affine/graphql';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { nanoid } from 'nanoid';
|
||||
@@ -25,7 +24,7 @@ export const CancelAction = ({
|
||||
}: {
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
module: MixpanelEvents['PlanChangeStarted']['module'];
|
||||
module: string;
|
||||
} & PropsWithChildren) => {
|
||||
const [idempotencyKey, setIdempotencyKey] = useState(nanoid());
|
||||
const [isMutating, setIsMutating] = useState(false);
|
||||
|
||||
+1
-2
@@ -3,7 +3,6 @@ import { useDowngradeNotify } from '@affine/core/components/affine/subscription-
|
||||
import { getDowngradeQuestionnaireLink } from '@affine/core/hooks/affine/use-subscription-notify';
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { mixpanel } from '@affine/core/mixpanel';
|
||||
import type { MixpanelEvents } from '@affine/core/mixpanel/events';
|
||||
import { AuthService, SubscriptionService } from '@affine/core/modules/cloud';
|
||||
import { SubscriptionPlan } from '@affine/graphql';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
@@ -12,7 +11,7 @@ import { nanoid } from 'nanoid';
|
||||
import { useState } from 'react';
|
||||
|
||||
export interface AICancelProps extends ButtonProps {
|
||||
module: MixpanelEvents['PlanChangeStarted']['module'];
|
||||
module: string;
|
||||
}
|
||||
export const AICancel = ({ module, ...btnProps }: AICancelProps) => {
|
||||
const t = useI18n();
|
||||
|
||||
+1
-2
@@ -6,7 +6,6 @@ import {
|
||||
} from '@affine/component';
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { mixpanel } from '@affine/core/mixpanel';
|
||||
import type { MixpanelEvents } from '@affine/core/mixpanel/events';
|
||||
import { SubscriptionService } from '@affine/core/modules/cloud';
|
||||
import { SubscriptionPlan } from '@affine/graphql';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
@@ -17,7 +16,7 @@ import { nanoid } from 'nanoid';
|
||||
import { useState } from 'react';
|
||||
|
||||
export interface AIResumeProps extends ButtonProps {
|
||||
module: MixpanelEvents['PlanChangeStarted']['module'];
|
||||
module: string;
|
||||
}
|
||||
|
||||
export const AIResume = ({ module, ...btnProps }: AIResumeProps) => {
|
||||
|
||||
@@ -81,10 +81,6 @@ export const RootAppSidebar = (): ReactElement => {
|
||||
const cmdkQuickSearchService = useService(CMDKQuickSearchService);
|
||||
const onOpenQuickSearchModal = useCallback(() => {
|
||||
cmdkQuickSearchService.toggle();
|
||||
mixpanel.track('QuickSearchOpened', {
|
||||
segment: 'navigation panel',
|
||||
control: 'search button',
|
||||
});
|
||||
}, [cmdkQuickSearchService]);
|
||||
|
||||
const allPageActive = currentPath === '/all';
|
||||
@@ -157,6 +153,7 @@ export const RootAppSidebar = (): ReactElement => {
|
||||
<QuickSearchInput
|
||||
className={quickSearch}
|
||||
data-testid="slider-bar-quick-search-button"
|
||||
data-event-props="$.navigationPanel.generalFunction.quickSearch"
|
||||
onClick={onOpenQuickSearchModal}
|
||||
/>
|
||||
<AddPageButton onClick={onClickNewPage} />
|
||||
|
||||
Reference in New Issue
Block a user