Skip to content

Commit c242f7f

Browse files
fix (global color schemes): tweak descriptions and labels
1 parent 4d602f3 commit c242f7f

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

src/plugins/global-settings/color-schemes/color-scheme-picker.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,10 @@ const ColorSchemePicker = props => {
376376
}
377377
}
378378

379+
const isNameReadOnly = itemInEdit?.key === 'scheme-default-1' ? true
380+
: ! isPro && itemInEdit?.key === 'scheme-default-2' ? true
381+
: false
382+
379383
return ( ! itemInEdit ? <SortablePicker
380384
ref={ ref }
381385
{ ...props }
@@ -404,18 +408,22 @@ const ColorSchemePicker = props => {
404408
onDuplicate={ () => onDuplicate( itemInEdit ) }
405409
/>
406410
<div className="stk-global-color-scheme__edit-panel-preview">
407-
<p> { __( 'Editing this scheme will also change all blocks that currently use this color scheme.', i18n ) } </p>
411+
{
412+
! isPro && itemInEdit.key === 'scheme-default-1'
413+
? <p> { __( 'Change the color scheme used for all blocks, and when the container option is enabled for a block.', i18n ) } </p>
414+
: ! isPro && itemInEdit.key === 'scheme-default-2'
415+
? <p> { __( 'Change the color scheme applied when the background option is enabled for a block.', i18n ) } </p>
416+
: <p> { __( 'Editing this scheme will also change all blocks that currently use this color scheme.', i18n ) } </p>
417+
}
408418

409419
<ItemPreview item={ itemInEdit } withWrapper={ true } />
410420
<AdvancedTextControl
411421
label={ __( 'Color Scheme Name', i18n ) }
412422
hasPanelModifiedIndicator={ false }
413423
value={ itemInEdit?.name }
414424
allowReset={ false }
415-
{ ...{
416-
readOnly: itemInEdit?.key === 'scheme-default-1' ? true : false,
417-
onChange: itemInEdit?.key === 'scheme-default-1' ? null : name => onChangeName( name ),
418-
} }
425+
readOnly={ isNameReadOnly }
426+
onChange={ onChangeName }
419427
/>
420428
</div>
421429

@@ -443,7 +451,13 @@ const ColorSchemePicker = props => {
443451
hover={ getAllowedHover( settings.property ) }
444452
forceUpdateHoverState={ true }
445453
onChange={ color => onChange( settings.property, color ) }
446-
help={ settings.property === 'backgroundColor' ? __( 'Note: Background color is not used for Base Color Scheme.', i18n ) : '' }
454+
help={
455+
! isPro && itemInEdit.key === 'scheme-default-1' && settings.property === 'backgroundColor'
456+
? __( 'Note: This background color is used when the container option of the block is enabled.', i18n )
457+
: isPro && settings.property === 'backgroundColor'
458+
? __( 'Note: Background color is not used for Base Color Scheme.', i18n )
459+
: ''
460+
}
447461
hasGradientPicker={ hasGradientPicker( settings.property ) }
448462
enableGradient={ currentHoverState === 'normal' || settings.property === 'buttonBackgroundColor' }
449463
additionalToggleProps={ getToggleProps( settings ) }

src/plugins/global-settings/color-schemes/store.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* External dependencies
33
*/
44
import { fetchSettings } from '~stackable/util'
5+
import { i18n } from 'stackable'
56

67
/**
78
* WordPress dependencies
@@ -10,6 +11,7 @@ import {
1011
register, createReduxStore, dispatch,
1112
} from '@wordpress/data'
1213
import domReady from '@wordpress/dom-ready'
14+
import { __ } from '@wordpress/i18n'
1315

1416
// Include all the stored state.
1517
const DEFAULT_STATE = {
@@ -78,7 +80,7 @@ domReady( () => {
7880
} = response
7981

8082
const colorSchemes = Array.isArray( _colorSchemes ) && _colorSchemes.length > 0 ? _colorSchemes : [ {
81-
name: 'Default Scheme',
83+
name: __( 'Default Scheme', i18n ),
8284
key: 'scheme-default-1',
8385
colorScheme: {
8486
backgroundColor: { desktop: '' },
@@ -92,7 +94,7 @@ domReady( () => {
9294
},
9395
hideInPicker: false,
9496
}, {
95-
name: 'Color Scheme 2',
97+
name: __( 'Background Scheme', i18n ),
9698
key: 'scheme-default-2',
9799
colorScheme: {
98100
backgroundColor: { desktop: '' },

0 commit comments

Comments
 (0)