mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
category search, make multiple layouts on one page possible
This commit is contained in:
parent
87b2fde0af
commit
a283cd162b
@ -22,7 +22,7 @@ interface HomeProps {
|
||||
|
||||
interface HomeState {
|
||||
search?: string
|
||||
categoryAssets?: Array<any>
|
||||
categoryAssets?: any[]
|
||||
isLoadingCategory?: boolean
|
||||
lastAssets?: any[]
|
||||
isLoadingLast?: boolean
|
||||
@ -33,7 +33,6 @@ const categories =
|
||||
formPublish.steps[1].fields.categories &&
|
||||
formPublish.steps[1].fields.categories.options) ||
|
||||
[]
|
||||
]
|
||||
|
||||
class Home extends Component<HomeProps, HomeState> {
|
||||
public state = {
|
||||
@ -109,7 +108,6 @@ class Home extends Component<HomeProps, HomeState> {
|
||||
title={meta.title}
|
||||
description={meta.description}
|
||||
className={styles.home}
|
||||
wide
|
||||
>
|
||||
<Content>
|
||||
<Form onSubmit={this.searchAssets} minimal>
|
||||
|
@ -40,7 +40,12 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
|
||||
|
||||
public async componentDidMount() {
|
||||
const { search } = this.props.location
|
||||
.text
|
||||
const searchPage = await queryString.parse(this.props.location.search)
|
||||
.page
|
||||
const { text, page, categories } = queryString.parse(search)
|
||||
this.props.location.search
|
||||
).categories
|
||||
|
||||
if (text) {
|
||||
await this.setState({
|
||||
@ -79,6 +84,7 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
|
||||
page: currentPage,
|
||||
query: {
|
||||
...queryValues,
|
||||
categories: [decodeURIComponent(searchCategories)],
|
||||
price: [-1, 1]
|
||||
},
|
||||
sort: {
|
||||
|
Loading…
Reference in New Issue
Block a user