Skip to content

Commit

Permalink
Update: Restrict edition of theme colors by users. (#27250)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta authored Nov 25, 2020
1 parent b0dcbd0 commit 580db95
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/components/src/color-edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ function ColorOption( {
);

const isShowingControls =
isHover || isFocused || isEditingName || isShowingAdvancedPanel;
( isHover || isFocused || isEditingName || isShowingAdvancedPanel ) &&
! immutableColorSlugs.includes( slug );

return (
<div
Expand Down Expand Up @@ -119,9 +120,7 @@ function ColorOption( {
onChange={ ( newColorName ) =>
onChange( {
color,
slug: immutableColorSlugs.includes( slug )
? slug
: kebabCase( newColorName ),
slug: kebabCase( newColorName ),
name: newColorName,
} )
}
Expand Down

0 comments on commit 580db95

Please sign in to comment.