mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-13 04:09:27 +00:00
Implemented library search and installation
This commit is contained in:
@@ -7,7 +7,7 @@ export class ComponentList extends React.Component<ComponentList.Props> {
|
||||
|
||||
render(): React.ReactNode {
|
||||
return <div>
|
||||
{this.props.items.map(item => <ComponentListItem key={item.name} item={item} windowService={this.props.windowService} install={this.props.install} />)}
|
||||
{this.props.items.map((item, idx) => <ComponentListItem key={idx} item={item} windowService={this.props.windowService} install={this.props.install} />)}
|
||||
</div>;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,15 @@ export class FilterableListContainer extends React.Component<FilterableListConta
|
||||
const { items } = result;
|
||||
this.setState({
|
||||
filterText,
|
||||
items
|
||||
items: items.sort((a, b) => {
|
||||
if (a.name < b.name) {
|
||||
return -1;
|
||||
} else if (a.name === b.name) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user