/
githubmirror
/
wp-calypso
Обзор
Документация
Войти
/
githubmirror
/
wp-calypso
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
client/hosting/performance/controller.tsx
24 строки
865 B
Griffith Chen
MSD: Add Tracks events (#107486)
04 дек 2025, 12:19
Не верифицирован
04 дек 2025, 12:19
13cb7b7
Код
Авторство
О чём код?
import { DotcomFeatures } from '@automattic/api-core'; import { PerformanceCallout } from 'calypso/dashboard/sites/performance/performance-callout'; import PageViewTracker from 'calypso/lib/analytics/page-view-tracker'; import { hostingFeaturesCallout } from 'calypso/sites/hosting/controller'; import { getRouteFromContext } from 'calypso/utils'; import { SitePerformance } from './site-performance'; import type { Context as PageJSContext } from '@automattic/calypso-router'; export function sitePerformance( context: PageJSContext, next: () => void ) { const path = getRouteFromContext( context ); context.primary = ( <> <PageViewTracker path={ path } title="Site Performance" /> <SitePerformance path={ path } /> </> ); next(); } export const sitePerformanceCallout = hostingFeaturesCallout( PerformanceCallout, DotcomFeatures.PERFORMANCE );