Skip to content

Commit

Permalink
Fix color panel
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Sep 20, 2021
1 parent ec8f7c8 commit 6dc5e41
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const PanelColorGradientSettingsInner = ( {
children,
settings,
title,
showTitle,
showTitle = true,
...props
} ) => {
if (
Expand Down Expand Up @@ -121,13 +121,14 @@ export const PanelColorGradientSettingsInner = ( {
/>
</span>
);

return (
<PanelBody
className={ classnames(
'block-editor-panel-color-gradient-settings',
className
) }
title={ showTitle && titleElement }
title={ showTitle ? titleElement : undefined }
{ ...props }
>
{ settings.map( ( setting, index ) => (
Expand Down
5 changes: 4 additions & 1 deletion packages/block-editor/src/hooks/color-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { useState, useEffect } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
Expand All @@ -19,6 +20,7 @@ export default function ColorPanel( {
settings,
clientId,
enableContrastChecking = true,
showTitle = true,
} ) {
const [ detectedBackgroundColor, setDetectedBackgroundColor ] = useState();
const [ detectedColor, setDetectedColor ] = useState();
Expand Down Expand Up @@ -54,9 +56,10 @@ export default function ColorPanel( {
return (
<InspectorControls>
<PanelColorGradientSettings
title={ __( 'Color' ) }
initialOpen={ false }
settings={ settings }
showTitle={ false }
showTitle={ showTitle }
>
{ enableContrastChecking && (
<ContrastChecker
Expand Down
1 change: 1 addition & 0 deletions packages/edit-site/src/components/sidebar/color-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export default function ColorPanel( {
gradients={ gradients }
disableCustomColors={ ! areCustomSolidsEnabled }
disableCustomGradients={ ! areCustomGradientsEnabled }
showTitle={ false }
>
<ColorPalettePanel
key={ 'color-palette-panel-' + name }
Expand Down

0 comments on commit 6dc5e41

Please sign in to comment.