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 all commits
Commits
File filter

Filter by extension

Filter by extension

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

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

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

return settings;
}

Expand Down Expand Up @@ -124,8 +114,6 @@ class Editor extends Component {
post,
postId,
postType,
colors,
gradients,
initialHtml,
editorMode,
...props
Expand All @@ -136,9 +124,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
Original file line number Diff line number Diff line change
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
5 changes: 3 additions & 2 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ For each user feature we should also add a importance categorization label to i

## Unreleased

* [***] Adding support for selecting different unit of value in Cover and Columns blocks
* [**] Button block - Add link picker to the block settings
* [***] Adding support for selecting different unit of value in Cover and Columns blocks [#26161]
* [**] Button block - Add link picker to the block settings [#26206]
* [*] Fix theme colors syncing with the editor [#26821]

## 1.41.0

Expand Down