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

[RNMobile] Support Theme Colors and Gradients #22197

Merged
merged 15 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add support for custom gradients
  • Loading branch information
chipsnyder committed May 7, 2020
commit 08bca9bab8d8cc7d5af87d69322ef2fe68accd19
11 changes: 9 additions & 2 deletions packages/edit-post/src/editor.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class Editor extends Component {
focusMode,
hiddenBlockTypes,
blockTypes,
colors
colors,
gradients
) {
settings = {
...settings,
Expand Down Expand Up @@ -70,6 +71,10 @@ class Editor extends Component {
settings.colors = colors;
}

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

return settings;
}

Expand Down Expand Up @@ -104,6 +109,7 @@ class Editor extends Component {
post,
postType,
colors,
gradients,
...props
} = this.props;

Expand All @@ -113,7 +119,8 @@ class Editor extends Component {
focusMode,
hiddenBlockTypes,
blockTypes,
colors
colors,
gradients
);

const normalizedPost = post || {
Expand Down
4 changes: 2 additions & 2 deletions packages/editor/src/components/provider/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class NativeEditorProvider extends Component {
);

this.subscriptionParentUpdateTheme = subscribeUpdateTheme(
( colors ) => {
this.props.updateSettings( { colors } );
( theme ) => {
this.props.updateSettings( theme );
}
);
}
Expand Down