Skip to content

Commit

Permalink
Refactor color panel and color palette components
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishit30G committed Feb 12, 2025
1 parent 208c842 commit 0ac8c96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ const LabeledColorIndicators = ( { indicators, label } ) => (
function ColorPanelTab( {
isGradient,
inheritedValue,
userValue,
setValue,
colorGradientControlSettings,
} ) {
Expand All @@ -191,7 +190,6 @@ function ColorPanelTab( {
gradientValue={ isGradient ? inheritedValue : undefined }
onColorChange={ isGradient ? undefined : setValue }
onGradientChange={ isGradient ? setValue : undefined }
clearable={ inheritedValue === userValue }
headingLevel={ 3 }
/>
);
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/color-palette/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ function UnforwardedColorPalette(
value,
};

const actions = (
const actions = !! clearable && (
<CircularOptionPicker.ButtonAction
onClick={ clearColor }
accessibleWhenDisabled
disabled={ ! value || ! clearable }
disabled={ ! value }
>
{ __( 'Clear' ) }
</CircularOptionPicker.ButtonAction>
Expand Down

0 comments on commit 0ac8c96

Please sign in to comment.