Skip to content

Commit 6020728

Browse files
committed
Masterbar: Fix Horizon crash rendering wordpress icon
Wrap string icons in Gridicon, matching item.tsx approach.
1 parent 9c43891 commit 6020728

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

client/layout/masterbar/logged-in.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import config from '@automattic/calypso-config';
22
import { isEcommercePlan } from '@automattic/calypso-products';
33
import page from '@automattic/calypso-router';
4+
import { Gridicon } from '@automattic/components';
45
import { Badge } from '@automattic/ui';
56
import { createInterpolateElement } from '@wordpress/element';
67
import { __, _x, sprintf } from '@wordpress/i18n';
@@ -660,7 +661,12 @@ class MasterbarLoggedIn extends Component {
660661
label: (
661662
<span className="button wpcom-button">
662663
{ createInterpolateElement( __( 'My <wpcomIcon /> WordPress.com Account' ), {
663-
wpcomIcon: this.wordpressIcon(),
664+
wpcomIcon:
665+
typeof this.wordpressIcon() !== 'string' ? (
666+
this.wordpressIcon()
667+
) : (
668+
<Gridicon icon={ this.wordpressIcon() } size={ 24 } />
669+
),
664670
} ) }
665671
</span>
666672
),

0 commit comments

Comments
 (0)