mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-07 09:28:32 +00:00
Use eslint&prettier for code linting&formatting
This commit is contained in:
committed by
Francesco Stasi
parent
2a3873a923
commit
0592199858
@@ -1,38 +1,39 @@
|
||||
import * as React from 'react';
|
||||
|
||||
export class SearchBar extends React.Component<SearchBar.Props> {
|
||||
|
||||
constructor(props: Readonly<SearchBar.Props>) {
|
||||
super(props);
|
||||
this.handleFilterTextChange = this.handleFilterTextChange.bind(this);
|
||||
}
|
||||
|
||||
render(): React.ReactNode {
|
||||
return <input
|
||||
return (
|
||||
<input
|
||||
ref={this.setRef}
|
||||
className={`theia-input ${SearchBar.Styles.SEARCH_BAR_CLASS}`}
|
||||
type='text'
|
||||
placeholder='Filter your search...'
|
||||
type="text"
|
||||
placeholder="Filter your search..."
|
||||
size={1}
|
||||
value={this.props.filterText}
|
||||
onChange={this.handleFilterTextChange}
|
||||
/>;
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
private setRef = (element: HTMLElement | null) => {
|
||||
if (this.props.resolveFocus) {
|
||||
this.props.resolveFocus(element || undefined);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private handleFilterTextChange(event: React.ChangeEvent<HTMLInputElement>): void {
|
||||
private handleFilterTextChange(
|
||||
event: React.ChangeEvent<HTMLInputElement>
|
||||
): void {
|
||||
this.props.onFilterTextChanged(event.target.value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export namespace SearchBar {
|
||||
|
||||
export interface Props {
|
||||
filterText: string;
|
||||
onFilterTextChanged(filterText: string): void;
|
||||
@@ -42,5 +43,4 @@ export namespace SearchBar {
|
||||
export namespace Styles {
|
||||
export const SEARCH_BAR_CLASS = 'search-bar';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user