Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mobile] - Theme colors sync #26821

Merged
merged 6 commits into from Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 2 additions & 16 deletions packages/edit-post/src/editor.native.js
Expand Up @@ -43,9 +43,7 @@ class Editor extends Component {
hasFixedToolbar,
focusMode,
hiddenBlockTypes,
blockTypes,
colors,
gradients
blockTypes
) {
settings = {
...settings,
Expand All @@ -70,14 +68,6 @@ class Editor extends Component {
);
}

if ( colors !== undefined ) {
settings.colors = colors;
}

if ( gradients !== undefined ) {
settings.gradients = gradients;
}

return settings;
}

Expand Down Expand Up @@ -119,8 +109,6 @@ class Editor extends Component {
post,
postId,
postType,
colors,
gradients,
initialHtml,
editorMode,
...props
Expand All @@ -131,9 +119,7 @@ class Editor extends Component {
hasFixedToolbar,
focusMode,
hiddenBlockTypes,
blockTypes,
colors,
gradients
blockTypes
);

const normalizedPost = post || {
Expand Down
9 changes: 7 additions & 2 deletions packages/editor/src/components/provider/index.native.js
Expand Up @@ -73,9 +73,14 @@ class NativeEditorProvider extends Component {
}

componentDidMount() {
const { capabilities } = this.props;
const { capabilities, colors, gradients } = this.props;

this.props.updateSettings( capabilities );
this.props.updateSettings( {
...capabilities,
// Set theme colors for the editor
...( colors ? { colors } : {} ),
...( gradients ? { gradients } : {} ),
} );

this.subscriptionParentGetHtml = subscribeParentGetHtml( () => {
this.serializeToNativeAction();
Expand Down