/
githubmirror
/
wp-calypso
Обзор
Документация
Войти
/
githubmirror
/
wp-calypso
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
client/reader/conversations/controller.jsx
81 строка
2 KB
Gabriel Caires
Reader: Keep the primary panel visible between lazy-loaded pages (#112911)
23 июл 2026, 15:33
Не верифицирован
23 июл 2026, 15:33
8ab6255
Код
Авторство
О чём код?
import AsyncLoad from 'calypso/components/async-load'; import { sectionify } from 'calypso/lib/route'; import { trackPageLoad, trackScrollPage } from 'calypso/reader/controller-helper'; import { recordTrack } from 'calypso/reader/stats'; import getCurrentRoute from 'calypso/state/selectors/get-current-route'; const loadStream = () => import( /* webpackChunkName: "async-load-calypso-reader-conversations-stream" */ 'calypso/reader/conversations/stream' ); export function conversations( context, next ) { const basePath = sectionify( context.path ); const mcKey = 'conversations'; const title = 'Reader > Conversations'; const state = context.store.getState(); trackPageLoad( basePath, 'Reader > Conversations', mcKey ); recordTrack( 'calypso_reader_conversations_viewed', {}, { pathnameOverride: getCurrentRoute( state ) } ); const streamKey = 'conversations'; const scrollTracker = trackScrollPage.bind( null, '/reader/conversations', title, 'Reader', mcKey ); context.primary = ( <AsyncLoad require={ loadStream } key="conversations" streamKey={ streamKey } trackScrollPage={ scrollTracker } placeholder={ null } /> ); next(); } export function conversationsA8c( context, next ) { const basePath = sectionify( context.path ); const mcKey = 'conversations-a8c'; const title = 'Reader > Conversations > Automattic'; const state = context.store.getState(); trackPageLoad( basePath, 'Reader > Conversations > Automattic', mcKey ); recordTrack( 'calypso_reader_conversations_automattic_viewed', {}, { pathnameOverride: getCurrentRoute( state ) } ); const streamKey = 'conversations-a8c'; const scrollTracker = trackScrollPage.bind( null, '/reader/conversations/a8c', title, 'Reader', mcKey ); context.primary = ( <AsyncLoad require={ loadStream } key="conversations" title="Conversations @ Automattic" streamKey={ streamKey } store={ { id: streamKey } } trackScrollPage={ scrollTracker } placeholder={ null } /> ); next(); }