client/my-sites/controller.js
function createSitesComponent( context ) {
	const contextPath = sectionify( context.path );

	// This path sets the URL to be visited once a site is selected
	const basePath = contextPath === '/sites' ? '/stats' : contextPath;

	analytics.pageView.record( contextPath, sitesPageTitleForAnalytics );

	return (
		<SitesComponent
			siteBasePath={ basePath }
			getSiteSelectionHeaderText={ context.getSiteSelectionHeaderText }
		/>
	);
}
function createSitesComponent( context ) {
	const contextPath = sectionify( context.path );

	// This path sets the URL to be visited once a site is selected
	const basePath = contextPath === '/sites' ? '/stats' : contextPath;

	analytics.pageView.record( contextPath, sitesPageTitleForAnalytics );

	return (
		<SitesComponent
			siteBasePath={ basePath }
			getSiteSelectionHeaderText={ context.getSiteSelectionHeaderText }
		/>
	);
}
function createSitesComponent ( context ) { const contextPath = sectionify ( context . path ) ; // This path sets the URL to be visited once a site is selected const basePath = contextPath === '/sites' ? '/stats' : contextPath ; analytics . pageView . record ( contextPath , sitesPageTitleForAnalytics ) ; return ( < SitesComponent siteBasePath = { basePath } getSiteSelectionHeaderText = { context . getSiteSelectionHeaderText } / > ) ; }
Returns the site-picker react element.

@param {object} context -- Middleware context
@returns {object} A site-picker React element
Returns the site - picker react element .