File size: 1,887 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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';

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="calypso/reader/conversations/stream"
			key="conversations"
			streamKey={ streamKey }
			trackScrollPage={ scrollTracker }
		/>
	);
	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="calypso/reader/conversations/stream"
			key="conversations"
			title="Conversations @ Automattic"
			streamKey={ streamKey }
			store={ { id: streamKey } }
			trackScrollPage={ scrollTracker }
		/>
	);
	next();
}