File size: 1,288 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
import config from '@automattic/calypso-config';
import { useTranslate } from 'i18n-calypso';
import NavigationHeader from 'calypso/components/navigation-header';
import { createWordPressDesktopConfig, createWordPressStudioConfig } from './apps-config';
import DesktopDownloadCard from './desktop-download-card';
import MobileDownloadCard from './mobile-download-card';

import './style.scss';

export const GetApps = () => {
	const translate = useTranslate();
	const envId = config( 'env_id' );
	const isDesktopEnv = typeof envId === 'string' && envId.startsWith( 'desktop' );

	const desktopApps = [
		createWordPressStudioConfig( translate ),
		createWordPressDesktopConfig( translate ),
	];

	return (
		<>
			<NavigationHeader title={ translate( 'Apps' ) } />
			<div className="get-apps__wrapper">
				<h2 className="get-apps__section-title">{ translate( 'Desktop' ) }</h2>
				<div className="get-apps__section">
					{ ! isDesktopEnv &&
						desktopApps.map( ( appConfig ) => (
							<DesktopDownloadCard key={ appConfig.id } appConfig={ appConfig } />
						) ) }
				</div>
				<h2 className="get-apps__section-title">{ translate( 'Mobile' ) }</h2>
				<div className="get-apps__section">
					<MobileDownloadCard />
				</div>
			</div>
		</>
	);
};

export default GetApps;