Implemented library search and installation

This commit is contained in:
Christian Weichel
2019-05-07 17:04:37 +02:00
parent 50c1c7dcb2
commit 2f7d26ded9
13 changed files with 738 additions and 94 deletions

View File

@@ -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>;
}

View File

@@ -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;
}
})
});
});
}