Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use shorthand Fragment syntax everywhere #2444

Merged
merged 1 commit into from
May 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions assets/src/block-editor/blocks/amp-brid-player/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
import { Fragment } from '@wordpress/element';
import {
PanelBody,
TextControl,
Expand Down Expand Up @@ -91,7 +90,7 @@ export const settings = {
url = `http://cdn.brid.tv/live/partners/${ dataPartner }`;
}
return (
<Fragment>
<>
<InspectorControls>
<PanelBody title={ __( 'Brid Player Settings', 'amp' ) }>
<TextControl
Expand Down Expand Up @@ -135,7 +134,7 @@ export const settings = {
</Placeholder>
)
}
</Fragment>
</>
);
},

Expand Down
5 changes: 2 additions & 3 deletions assets/src/block-editor/blocks/amp-ima-video/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
import { Fragment } from '@wordpress/element';
import {
PanelBody,
TextControl,
Expand Down Expand Up @@ -83,7 +82,7 @@ export const settings = {
dataSet = true;
}
return (
<Fragment>
<>
<InspectorControls>
<PanelBody title={ __( 'IMA Video Settings', 'amp' ) }>
<TextControl
Expand Down Expand Up @@ -117,7 +116,7 @@ export const settings = {
</Placeholder>
)
}
</Fragment>
</>
);
},

Expand Down
5 changes: 2 additions & 3 deletions assets/src/block-editor/blocks/amp-jwplayer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
import { Fragment } from '@wordpress/element';
import {
PanelBody,
TextControl,
Expand Down Expand Up @@ -83,7 +82,7 @@ export const settings = {
}
}
return (
<Fragment>
<>
<InspectorControls>
<PanelBody title={ __( 'JW Player Settings', 'amp' ) }>
<TextControl
Expand Down Expand Up @@ -112,7 +111,7 @@ export const settings = {
</Placeholder>
)
}
</Fragment>
</>
);
},

Expand Down
13 changes: 5 additions & 8 deletions assets/src/block-editor/blocks/amp-latest-stories/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import { isUndefined, pickBy } from 'lodash';
/**
* WordPress dependencies
*/
import {
Component,
Fragment,
} from '@wordpress/element';
import { Component } from '@wordpress/element';
import {
PanelBody,
Placeholder,
Expand Down Expand Up @@ -69,7 +66,7 @@ class LatestStoriesEdit extends Component {
const hasStories = Array.isArray( latestStories ) && latestStories.length;
if ( ! hasStories ) {
return (
<Fragment>
<>
{ inspectorControls }
<Placeholder
icon="admin-post"
Expand All @@ -80,20 +77,20 @@ class LatestStoriesEdit extends Component {
__( 'No stories found.', 'amp' )
}
</Placeholder>
</Fragment>
</>
);
}

const serverSideAttributes = Object.assign( {}, attributes, { useCarousel: false } );

return (
<Fragment>
<>
{ inspectorControls }
<ServerSideRender
block={ blockName }
attributes={ serverSideAttributes }
/>
</Fragment>
</>
);
}
}
Expand Down
5 changes: 2 additions & 3 deletions assets/src/block-editor/blocks/amp-o2-player/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
import { Fragment } from '@wordpress/element';
import {
PanelBody,
TextControl,
Expand Down Expand Up @@ -89,7 +88,7 @@ export const settings = {
url = `https://delivery.vidible.tv/htmlembed/pid=${ dataPid }/`;
}
return (
<Fragment>
<>
<InspectorControls>
<PanelBody title={ __( 'O2 Player Settings', 'amp' ) }>
<TextControl
Expand Down Expand Up @@ -128,7 +127,7 @@ export const settings = {
</Placeholder>
)
}
</Fragment>
</>
);
},

Expand Down
5 changes: 2 additions & 3 deletions assets/src/block-editor/blocks/amp-ooyala-player/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
import { Fragment } from '@wordpress/element';
import {
PanelBody,
TextControl,
Expand Down Expand Up @@ -86,7 +85,7 @@ export const settings = {
url = `http://cf.c.ooyala.com/${ dataEmbedCode }`;
}
return (
<Fragment>
<>
<InspectorControls>
<PanelBody title={ __( 'Ooyala settings', 'amp' ) }>
<TextControl
Expand Down Expand Up @@ -122,7 +121,7 @@ export const settings = {
<p>{ __( 'Add required data to use the block.', 'amp' ) }</p>
</Placeholder>
) }
</Fragment>
</>
);
},

Expand Down
5 changes: 2 additions & 3 deletions assets/src/block-editor/blocks/amp-reach-player/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
import { Fragment } from '@wordpress/element';
import {
PanelBody,
TextControl,
Expand Down Expand Up @@ -69,7 +68,7 @@ export const settings = {
url = 'https://media-cdn.beachfrontreach.com/acct_1/video/';
}
return (
<Fragment>
<>
<InspectorControls>
<PanelBody title={ __( 'Reach settings', 'amp' ) }>
<TextControl
Expand All @@ -88,7 +87,7 @@ export const settings = {
</Placeholder>
)
}
</Fragment>
</>
);
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
import { Fragment } from '@wordpress/element';
import {
PanelBody,
TextControl,
Expand Down Expand Up @@ -95,7 +94,7 @@ export const settings = {
url = 'https://cms.springboardplatform.com/embed_iframe/';
}
return (
<Fragment>
<>
<InspectorControls>
<PanelBody title={ __( 'Springboard Player Settings', 'amp' ) }>
<TextControl
Expand Down Expand Up @@ -144,7 +143,7 @@ export const settings = {
</Placeholder>
)
}
</Fragment>
</>
);
},

Expand Down
5 changes: 2 additions & 3 deletions assets/src/block-editor/blocks/amp-timeago/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
PanelBody,
TextControl,
} from '@wordpress/components';
import { Fragment } from '@wordpress/element';

/**
* Internal dependencies
Expand Down Expand Up @@ -95,7 +94,7 @@ export const settings = {
];

return (
<Fragment>
<>
<InspectorControls>
<PanelBody title={ __( 'AMP Timeago Settings', 'amp' ) }>
<DateTimePicker
Expand Down Expand Up @@ -123,7 +122,7 @@ export const settings = {
/>
</BlockControls>
<time dateTime={ attributes.dateTime }>{ timeAgo }</time>
</Fragment>
</>
);
},

Expand Down
10 changes: 5 additions & 5 deletions assets/src/block-editor/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies
*/
import { __, _x } from '@wordpress/i18n';
import { cloneElement, RawHTML, Fragment } from '@wordpress/element';
import { cloneElement, RawHTML } from '@wordpress/element';
import { TextControl, SelectControl, ToggleControl, Notice, PanelBody, FontSizePicker } from '@wordpress/components';
import { InspectorControls } from '@wordpress/block-editor';
import { select } from '@wordpress/data';
Expand Down Expand Up @@ -400,10 +400,10 @@ export const filterBlocksEdit = ( BlockEdit ) => {
}

return (
<Fragment>
<>
<BlockEdit { ...props } />
{ inspectorControls }
</Fragment>
</>
);
};
};
Expand Down Expand Up @@ -576,7 +576,7 @@ const setUpTextBlocksInspectorControls = ( props ) => {
/>
</PanelBody>
{ ampFitText && (
<Fragment>
<>
<TextControl
label={ __( 'Height', 'amp' ) }
value={ height }
Expand Down Expand Up @@ -634,7 +634,7 @@ const setUpTextBlocksInspectorControls = ( props ) => {
} }
/>
</PanelBody>
</Fragment>
</>
) }
</InspectorControls>
);
Expand Down
6 changes: 3 additions & 3 deletions assets/src/block-editor/plugins/amp-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { errorMessages } from 'amp-block-editor-data';
*/
import { __ } from '@wordpress/i18n';
import { FormToggle, Notice } from '@wordpress/components';
import { Fragment, RawHTML } from '@wordpress/element';
import { RawHTML } from '@wordpress/element';
import { withSelect, withDispatch } from '@wordpress/data';
import { PluginPostStatusInfo } from '@wordpress/edit-post';
import { compose, withInstanceId } from '@wordpress/compose';
Expand All @@ -30,7 +30,7 @@ import { isAMPEnabled } from '../helpers';
*/
function AMPToggle( { isEnabled, onChange } ) {
return (
<Fragment>
<>
<PluginPostStatusInfo>
{ ! errorMessages.length && <label htmlFor="amp-enabled">{ __( 'Enable AMP', 'amp' ) }</label> }
{
Expand Down Expand Up @@ -59,7 +59,7 @@ function AMPToggle( { isEnabled, onChange } ) {
)
}
</PluginPostStatusInfo>
</Fragment>
</>
);
}

Expand Down
9 changes: 4 additions & 5 deletions assets/src/components/animation-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { withSelect } from '@wordpress/data';
import { RangeControl, SelectControl } from '@wordpress/components';
import { Fragment } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

/**
Expand Down Expand Up @@ -39,7 +38,7 @@ const AnimationControls = ( {
} );

return (
<Fragment>
<>
<SelectControl
label={ __( 'Animation Type', 'amp' ) }
value={ animationType }
Expand All @@ -53,7 +52,7 @@ const AnimationControls = ( {
} }
/>
{ animationType && (
<Fragment>
<>
<RangeControl
label={ __( 'Duration (ms)', 'amp' ) }
value={ animationDuration }
Expand All @@ -75,9 +74,9 @@ const AnimationControls = ( {
options={ animatedBlocks() }
onChange={ onAnimationAfterChange }
/>
</Fragment>
</>
) }
</Fragment>
</>
);
};

Expand Down
6 changes: 3 additions & 3 deletions assets/src/components/block-navigation/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import classnames from 'classnames';
*/
import { compose } from '@wordpress/compose';
import { Button, Draggable, DropZone } from '@wordpress/components';
import { Fragment, Component } from '@wordpress/element';
import { Component } from '@wordpress/element';
import { withDispatch, withSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

Expand Down Expand Up @@ -106,7 +106,7 @@ class BlockNavigationItem extends Component {
>
{
( { onDraggableStart, onDraggableEnd } ) => (
<Fragment>
<>
<DropZone
className={ this.state.isDragging ? 'is-dragging-block' : undefined }
onDrop={ this.onDrop }
Expand All @@ -129,7 +129,7 @@ class BlockNavigationItem extends Component {
accessibilityText={ isSelected && __( '(selected block)', 'amp' ) }
/>
</Button>
</Fragment>
</>
)
}
</Draggable>
Expand Down
Loading