Fix saving styles to save only user-edited props
There was a typo in StylesColorPanel property, and we were passing incorrect values.
StylesColorPanel.value expects user set values
StylesColorPanel.inheritedValue expects merged styles
See b66f9ff095/packages/edit-site/src/components/global-styles/screen-colors.js (L23-L28)
[MAILPOET-6335]
This commit is contained in:
committed by
Aschepikov
parent
b5e8cf84c8
commit
c908cabcf6
@@ -17,7 +17,7 @@ import { useEmailStyles } from '../../../hooks';
|
||||
import { storeName } from '../../../store';
|
||||
|
||||
export function ScreenColors(): JSX.Element {
|
||||
const { styles, defaultStyles, updateStyles } = useEmailStyles();
|
||||
const { userStyles, styles, updateStyles } = useEmailStyles();
|
||||
const theme = useSelect( ( select ) => select( storeName ).getTheme(), [] );
|
||||
|
||||
return (
|
||||
@@ -30,8 +30,8 @@ export function ScreenColors(): JSX.Element {
|
||||
) }
|
||||
/>
|
||||
<StylesColorPanel
|
||||
value={ styles }
|
||||
inheritValue={ defaultStyles }
|
||||
value={ userStyles }
|
||||
inheritedValue={ styles }
|
||||
onChange={ updateStyles }
|
||||
settings={ theme?.settings }
|
||||
panelId="colors"
|
||||
|
Reference in New Issue
Block a user