Skip to content

Commit

Permalink
Remove unecessary span in favour of Fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Jul 17, 2018
1 parent c93bcd2 commit 0081052
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions editor/components/panel-color-settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
BaseControl,
ColorIndicator,
} from '@wordpress/components';
import { Fragment } from '@wordpress/element';
import { ifCondition, compose } from '@wordpress/compose';
import { sprintf } from '@wordpress/i18n';

Expand All @@ -35,23 +36,22 @@ const getColorIndicatorProps = ( colors, { value, colorIndicatorAriaLabel } ) =>
};
};

const TextWithColorIndicators = ( { className, text, colorIndicatorProps } ) => (
<span className={ className }>
const TextWithColorIndicators = ( { text, colorIndicatorProps } ) => (
<Fragment>
{ text }
{ colorIndicatorProps.map( ( props, index ) => props && (
<ColorIndicator
key={ index }
{ ...props }
/>
) ) }
</span>
</Fragment>
);

const ColorPaletteControl = ( { label, colors, ...settings } ) => {
const colorIndicatorProps = getColorIndicatorProps( colors, settings );
const labelElement = (
<TextWithColorIndicators
className="editor-panel-color-settings__color-palette"
text={ label }
colorIndicatorProps={ [ colorIndicatorProps ] }
/>
Expand Down

0 comments on commit 0081052

Please sign in to comment.