import { Gridicon } from '@automattic/components'; import { localizeUrl } from '@automattic/i18n-utils'; import PropTypes from 'prop-types'; import A4ALogo from 'calypso/a8c-for-agencies/components/a4a-logo'; import JetpackLogo from 'calypso/components/jetpack-logo'; import { isWooOAuth2Client, isJetpackCloudOAuth2Client, isA4AOAuth2Client, isBlazeProOAuth2Client, } from 'calypso/lib/oauth2-clients'; import BlazeProOauthMasterbar from './blaze-pro'; import WooOauthMasterbar from './woo'; import './blaze-pro.scss'; import './oauth-client.scss'; const clientLogo = ( oauth2Client ) => { if ( isJetpackCloudOAuth2Client( oauth2Client ) ) { return ; } else if ( isA4AOAuth2Client( oauth2Client ) ) { return ; } return oauth2Client.icon && ; }; const DefaultOauthClientMasterbar = ( { oauth2Client } ) => ( { clientLogo( oauth2Client ) } { ! isWooOAuth2Client( oauth2Client ) && ! isJetpackCloudOAuth2Client( oauth2Client ) && ! isA4AOAuth2Client( oauth2Client ) && ( WordPress.com ) } ); const OauthClientMasterbar = ( { oauth2Client } ) => { if ( isWooOAuth2Client( oauth2Client ) ) { return ; } /** * This is a special case for Blaze Pro that is used in both Login and Signup pages. * TODO clk Refactor (remove) this to use the same approach as the other oauth2 clients. */ if ( isBlazeProOAuth2Client( oauth2Client ) ) { return ; } return ; }; OauthClientMasterbar.displayName = 'OauthClientMasterbar'; OauthClientMasterbar.propTypes = { oauth2Client: PropTypes.object, }; export default OauthClientMasterbar;