Skip to content

Commit

Permalink
Add Ribbon to Paid blocks in block picker
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Oct 10, 2019
1 parent fefcec9 commit fbd5fa2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions extensions/shared/register-jetpack-block.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { addFilter } from '@wordpress/hooks';
import { registerBlockType } from '@wordpress/blocks';
import { Ribbon } from '@automattic/calypso-ui';

/**
* Internal dependencies
Expand Down Expand Up @@ -48,6 +50,14 @@ export default function registerJetpackBlock( name, settings, childBlocks = [] )
...settings,
title: betaExtensions.includes( name ) ? `${ settings.title } (beta)` : settings.title,
edit: requiredPlan ? wrapPaidBlock( { requiredPlan } )( settings.edit ) : settings.edit,
icon: requiredPlan ? (
<>
<Ribbon>{ __( 'Paid' ) }</Ribbon>
{ settings.icon }
</>
) : (
settings.icon
),
} );

if ( requiredPlan ) {
Expand Down

0 comments on commit fbd5fa2

Please sign in to comment.