import { Card, Button } from '@automattic/components'; import clsx from 'clsx'; import { useTranslate, useRtl } from 'i18n-calypso'; import wpToJpImageRtl from 'calypso/assets/images/jetpack/wp-to-jp-rtl.svg'; import wpToJpImage from 'calypso/assets/images/jetpack/wp-to-jp.svg'; import QrCode from 'calypso/blocks/app-promo/qr-code'; import AppsBadge from 'calypso/blocks/get-apps/apps-badge'; import CardHeading from 'calypso/components/card-heading'; import userAgent from 'calypso/lib/user-agent'; import './style.scss'; interface AppPromoProps { title?: string; iconSize?: number; campaign: string; subheader?: string; className?: string; hasQRCode?: boolean; hasGetAppButton?: boolean; } export const AppPromo = ( { title = '', iconSize = 29, campaign = 'calypso-app-promo', subheader = '', className = '', hasQRCode = false, hasGetAppButton = true, }: AppPromoProps ) => { const isRtl = useRtl(); const translate = useTranslate(); const iconWidth = Math.ceil( ( 49 / 29 ) * iconSize ); const { isiPad, isiPod, isiPhone, isAndroid } = userAgent; const isIos = isiPad || isiPod || isiPhone; const showIosBadge = isIos; const showAndroidBadge = isAndroid; const showBadge = showIosBadge || showAndroidBadge; return ( WordPress and Jetpack app
{ title || translate( 'Get our mobile app' ) } { ! showBadge &&

{ subheader }

}
{ showBadge && (
{ subheader &&

{ subheader }

}
) } { hasQRCode && ! showBadge && } { hasGetAppButton && ! showBadge && ( ) }
); }; export default AppPromo;