1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-17 18:44:45 +02:00

Refactor.

This commit is contained in:
mic074b 2020-01-17 17:13:28 +11:00
parent 6736bda429
commit c856e8d9ac

View File

@ -119,10 +119,9 @@ class NoteSearchBarComponent extends React.Component {
}
const theme = themeStyle(this.props.theme);
if (this.state.query.length === 0 || this.state.resultCount > 0) {
this.state.backgroundColor = theme.backgroundColor;
} else {
this.state.backgroundColor = theme.warningBackgroundColor;
let backgroundColor = theme.backgroundColor;
if (this.state.query.length > 0 && this.state.resultCount === 0) {
backgroundColor = theme.warningBackgroundColor;
}
return (
@ -136,7 +135,7 @@ class NoteSearchBarComponent extends React.Component {
onKeyDown={this.searchInput_keyDown}
ref="searchInput"
type="text"
style={{ width: 200, marginRight: 5, backgroundColor: this.state.backgroundColor }}
style={{ width: 200, marginRight: 5, backgroundColor: backgroundColor }}
/>
{nextButton}
{previousButton}