Skip to content

Commit

Permalink
Block Editor: Unify responsive block control group wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Feb 7, 2020
1 parent e3f7a7f commit b4a46ad
Showing 1 changed file with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
/**
* External dependencies
*/
import classnames from 'classnames';

/**
* WordPress dependencies
*/
import { __, sprintf } from '@wordpress/i18n';

import { Fragment } from '@wordpress/element';

import { ToggleControl } from '@wordpress/components';

/**
Expand Down Expand Up @@ -93,23 +96,20 @@ function ResponsiveBlockControl( props ) {
onChange={ onIsResponsiveChange }
help={ toggleHelpText }
/>

{ ! isResponsive && (
<div className="block-editor-responsive-block-control__group">
{ defaultControl }
</div>
) }

{ isResponsive && (
<div
className="block-editor-responsive-block-control__group is-responsive"
hidden={ ! isResponsive }
>
{ renderResponsiveControls
<div
className={ classnames(
'block-editor-responsive-block-control__group',
{
'is-responsive': isResponsive,
}
) }
>
{ ! isResponsive && defaultControl }
{ isResponsive &&
( renderResponsiveControls
? renderResponsiveControls( viewports )
: defaultResponsiveControls() }
</div>
) }
: defaultResponsiveControls() ) }
</div>
</div>
</fieldset>
);
Expand Down

0 comments on commit b4a46ad

Please sign in to comment.