Skip to content

Commit

Permalink
Mobile - HTML mode - use theme styles (#35515)
Browse files Browse the repository at this point in the history
  • Loading branch information
geriux committed Oct 13, 2021
1 parent a2d95f7 commit cf02f3a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
27 changes: 17 additions & 10 deletions packages/components/src/mobile/html-text-input/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,30 @@ export class HTMLTextInput extends Component {
}

render() {
const { getStylesFromColorScheme } = this.props;
const htmlStyle = getStylesFromColorScheme(
styles.htmlView,
styles.htmlViewDark
);
const placeholderStyle = getStylesFromColorScheme(
styles.placeholder,
styles.placeholderDark
);
const { getStylesFromColorScheme, style } = this.props;
const titleStyle = [
styles.htmlViewTitle,
style?.text && { color: style.text },
];
const htmlStyle = [
getStylesFromColorScheme( styles.htmlView, styles.htmlViewDark ),
style?.text && { color: style.text },
];
const placeholderStyle = {
...getStylesFromColorScheme(
styles.placeholder,
styles.placeholderDark
),
...( style?.text && { color: style.text } ),
};
return (
<HTMLInputContainer parentHeight={ this.props.parentHeight }>
<TextInput
autoCorrect={ false }
accessibilityLabel="html-view-title"
textAlignVertical="center"
numberOfLines={ 1 }
style={ styles.htmlViewTitle }
style={ titleStyle }
value={ this.props.title }
placeholder={ __( 'Add title' ) }
placeholderTextColor={ placeholderStyle.color }
Expand Down
8 changes: 7 additions & 1 deletion packages/edit-post/src/components/layout/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ class Layout extends Component {
}

renderHTML() {
return <HTMLTextInput parentHeight={ this.state.rootViewHeight } />;
const { globalStyles } = this.props;
return (
<HTMLTextInput
parentHeight={ this.state.rootViewHeight }
style={ globalStyles }
/>
);
}

renderVisual() {
Expand Down

0 comments on commit cf02f3a

Please sign in to comment.