Skip to content

Commit

Permalink
Admin Page: avoid react warning with VideoPress card (#34713)
Browse files Browse the repository at this point in the history
This should avoid us getting the following warning:

```
Warning: Failed prop type: Invalid prop `overrideContent` of type `boolean` supplied to `DashItem`, expected a single ReactElement.
DashItem@wp-content/plugins/jetpack/_inc/build/admin.js?ver=28b3a12169ab227bdcfa:36878:1
SettingsForm@wp-content/plugins/jetpack/_inc/build/admin.js?ver=28b3a12169ab227bdcfa:43524:3
ConnectFunction@wp-content/plugins/jetpack/_inc/build/admin.js?ver=28b3a12169ab227bdcfa:8870:68
ConnectFunction@wp-content/plugins/jetpack/_inc/build/admin.js?ver=28b3a12169ab227bdcfa:8870:68
DashVideoPress@wp-content/plugins/jetpack/_inc/build/admin.js?ver=28b3a12169ab227bdcfa:34467:1
```
  • Loading branch information
jeherve authored Dec 19, 2023
1 parent d2b016c commit ec59880
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ class DashVideoPress extends Component {
className="jp-dash-item__is-inactive"
noToggle={ ! hasConnectedOwner }
overrideContent={
! hasConnectedOwner &&
! isOffline && (
! hasConnectedOwner && ! isOffline ? (
<JetpackBanner
callToAction={ __( 'Connect', 'jetpack' ) }
title={ __(
Expand All @@ -143,7 +142,7 @@ class DashVideoPress extends Component {
plan={ getJetpackProductUpsellByFeature( FEATURE_VIDEOPRESS ) }
icon="video"
/>
)
) : null
}
>
<p className="jp-dash-item__description">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Dashboard: avoid React warning when loading the VideoPress card.

0 comments on commit ec59880

Please sign in to comment.