diff --git a/client/blocks/app-banner/index.jsx b/client/blocks/app-banner/index.jsx index 95fd01c317adb..fa5bae1bbdf8d 100644 --- a/client/blocks/app-banner/index.jsx +++ b/client/blocks/app-banner/index.jsx @@ -149,15 +149,10 @@ export class AppBanner extends Component { return null; } - render() { - const { translate, currentSection } = this.props; - if ( ! this.props.shouldDisplayAppBanner || this.state.isDraftPostModalShown ) { - return null; - } + getJetpackAppBanner = ( { translate, currentSection, isRtl } ) => { + const { title, copy, icon } = getAppBannerData( translate, currentSection, isRtl ); - const { title, copy } = getAppBannerData( translate, currentSection ); - - const jetpackAppBanner = ( + return (
- +
{ title } @@ -196,8 +191,12 @@ export class AppBanner extends Component {
); + }; - const wordpressAppBanner = ( + getWordpressAppBanner = ( { translate, currentSection } ) => { + const { title, copy } = getAppBannerData( translate, currentSection ); + + return (
); + }; + + render() { + if ( ! this.props.shouldDisplayAppBanner || this.state.isDraftPostModalShown ) { + return null; + } const displayJetpackAppBranding = config.isEnabled( 'jetpack/app-branding' ); - return displayJetpackAppBranding ? jetpackAppBanner : wordpressAppBanner; + return displayJetpackAppBranding + ? this.getJetpackAppBanner( this.props ) + : this.getWordpressAppBanner( this.props ); } }