mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
lints
This commit is contained in:
parent
d0461228d5
commit
851777a1a6
@ -123,38 +123,49 @@ class Search extends PureComponent<SearchProps, SearchState> {
|
||||
search: `?text=${this.state.searchTerm}&page=${toPage}`
|
||||
})
|
||||
|
||||
this.setState({ currentPage: toPage, isLoading: true }, () => this.searchAssets())
|
||||
|
||||
this.setState({ currentPage: toPage, isLoading: true }, () =>
|
||||
this.searchAssets()
|
||||
)
|
||||
}
|
||||
|
||||
private inputChange = (event: ChangeEvent<HTMLInputElement> | ChangeEvent<HTMLSelectElement>) => {
|
||||
private inputChange = (
|
||||
event: ChangeEvent<HTMLInputElement> | ChangeEvent<HTMLSelectElement>
|
||||
) => {
|
||||
this.setState({
|
||||
[event.currentTarget.name]: event.currentTarget.value
|
||||
} as any)
|
||||
}
|
||||
|
||||
private search = (event: ChangeEvent<HTMLInputElement>) => {
|
||||
|
||||
let searchUrl = '?'
|
||||
|
||||
if (this.state.search) {
|
||||
searchUrl = `${searchUrl}text=${encodeURIComponent(this.state.search)}&`
|
||||
searchUrl = `${searchUrl}text=${encodeURIComponent(
|
||||
this.state.search
|
||||
)}&`
|
||||
}
|
||||
if (this.state.category) {
|
||||
searchUrl = `${searchUrl}categories=${encodeURIComponent(this.state.category)}&`
|
||||
searchUrl = `${searchUrl}categories=${encodeURIComponent(
|
||||
this.state.category
|
||||
)}&`
|
||||
}
|
||||
if (this.state.license) {
|
||||
searchUrl = `${searchUrl}license=${encodeURIComponent(this.state.license)}&`
|
||||
searchUrl = `${searchUrl}license=${encodeURIComponent(
|
||||
this.state.license
|
||||
)}&`
|
||||
}
|
||||
this.props.history.push({
|
||||
pathname: this.props.location.pathname,
|
||||
search: searchUrl
|
||||
})
|
||||
this.setState({
|
||||
this.setState(
|
||||
{
|
||||
searchTerm: this.state.search,
|
||||
currentPage: 1,
|
||||
isLoading: true
|
||||
}, () => this.searchAssets())
|
||||
},
|
||||
() => this.searchAssets()
|
||||
)
|
||||
}
|
||||
|
||||
public renderResults = () =>
|
||||
|
Loading…
Reference in New Issue
Block a user