File size: 969 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
import config from '@automattic/calypso-config';
import JetpackLogo from 'calypso/components/jetpack-logo';
import NavigationHeaderImpr, {
	HeaderProps,
} from 'calypso/components/navigation-header/navigation-header';
import { STATS_PRODUCT_NAME, STATS_PRODUCT_NAME_IMPR } from '../../constants';

function PageHeader( { titleProps, ...otherProps }: HeaderProps ) {
	const isOdysseyStats = config.isEnabled( 'is_running_in_jetpack_site' );

	if ( isOdysseyStats ) {
		return (
			<NavigationHeaderImpr
				className="stats__section-header modernized-header"
				titleProps={ {
					title: STATS_PRODUCT_NAME,
					titleLogo: <JetpackLogo size={ 24 } monochrome={ false } />,
					...titleProps,
				} }
				{ ...otherProps }
			/>
		);
	}

	return (
		<NavigationHeaderImpr
			className="stats__section-header modernized-header"
			titleProps={ {
				title: STATS_PRODUCT_NAME_IMPR,
				...titleProps,
			} }
			{ ...otherProps }
		/>
	);
}

export default PageHeader;