Fixes to filters (#54)

This commit is contained in:
Maciej Hirsz
2018-09-25 20:14:35 +02:00
committed by GitHub
parent 2e483a595f
commit 6ebebf2bff
2 changed files with 9 additions and 3 deletions
@@ -287,7 +287,7 @@ export class Chain extends React.Component<Chain.Props, Chain.State> {
}
private onFilterChange = (filter: string) => {
this.setState({ filter: filter.toLowerCase() });
this.setState({ filter });
}
private getNodeFilter(): Maybe<(node: AppState.Node) => boolean> {
@@ -299,6 +299,12 @@ export class Chain extends React.Component<Chain.Props, Chain.State> {
const filterLC = filter.toLowerCase();
return ({ nodeDetails }) => nodeDetails[0].indexOf(filterLC) !== -1;
return ({ nodeDetails, location }) => {
const city = location && location[2];
const matchesName = nodeDetails[0].toLowerCase().indexOf(filterLC) !== -1;
const matchesCity = city != null && city.toLowerCase().indexOf(filterLC) !== -1;
return matchesName || matchesCity;
}
}
}
@@ -48,7 +48,7 @@
}
.Node-Location:hover {
z-index: 3;
z-index: 4;
border-color: #fff;
}