import { Button } from '@wordpress/components'; import { chevronLeftSmall } from '@wordpress/icons'; import clsx from 'clsx'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { connect } from 'react-redux'; import DocumentHead from 'calypso/components/data/document-head'; import JetpackHeader from 'calypso/components/jetpack-header'; import Main from 'calypso/components/main'; import getPartnerSlugFromQuery from 'calypso/state/selectors/get-partner-slug-from-query'; import { retrieveMobileRedirect } from './persistence-utils'; export class JetpackConnectMainWrapper extends PureComponent { static propTypes = { isWide: PropTypes.bool, isWooJPC: PropTypes.bool, wooDnaConfig: PropTypes.object, partnerSlug: PropTypes.string, translate: PropTypes.func.isRequired, pageTitle: PropTypes.string, // Whether to use a compact logo in the left corner or the main center logo useCompactLogo: PropTypes.bool, compactBackButton: PropTypes.bool, }; static defaultProps = { isWide: false, isWooJPC: false, wooDnaConfig: null, useCompactLogo: false, }; render() { const { isWide, isWooJPC, isFromAutomatticForAgenciesPlugin, className, children, partnerSlug, translate, pageTitle, useCompactLogo, compactBackButton, } = this.props; const wrapperClassName = clsx( 'jetpack-connect__main', { 'is-wide': isWide, 'is-woocommerce': isWooJPC, 'is-woocommerce-core-profiler-flow': isWooJPC, 'is-mobile-app-flow': !! retrieveMobileRedirect(), 'is-automattic-for-agencies-flow': isFromAutomatticForAgenciesPlugin, } ); const darkColorScheme = false; return (
{ useCompactLogo && ( <>
{ compactBackButton && ( ) }
) } { ! useCompactLogo && ! isWooJPC && (
) } { children }
); } } export default connect( ( state ) => ( { partnerSlug: getPartnerSlugFromQuery( state ), } ) )( localize( JetpackConnectMainWrapper ) );