mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
wrapping search results in permissions wrapper
This commit is contained in:
parent
440afbdc05
commit
adb5a2fdc3
@ -1,4 +1,4 @@
|
|||||||
import React, { Children, ReactElement, useEffect, useState } from 'react'
|
import React, { ReactElement, useEffect, useState } from 'react'
|
||||||
import rbacRequest from '../../utils/rbac'
|
import rbacRequest from '../../utils/rbac'
|
||||||
|
|
||||||
export default function Permission({
|
export default function Permission({
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React, { ReactElement, useState, useEffect } from 'react'
|
import React, { ReactElement, useState, useEffect } from 'react'
|
||||||
|
import Permission from '../../organisms/Permission'
|
||||||
import { QueryResult } from '@oceanprotocol/lib/dist/node/metadatacache/MetadataCache'
|
import { QueryResult } from '@oceanprotocol/lib/dist/node/metadatacache/MetadataCache'
|
||||||
import SearchBar from '../../molecules/SearchBar'
|
import SearchBar from '../../molecules/SearchBar'
|
||||||
import AssetList from '../../organisms/AssetList'
|
import AssetList from '../../organisms/AssetList'
|
||||||
@ -74,43 +75,45 @@ export default function SearchPage({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Permission eventType="browse">
|
||||||
<div className={styles.search}>
|
<>
|
||||||
{(text || owner) && (
|
<div className={styles.search}>
|
||||||
<SearchBar initialValue={(text || owner) as string} />
|
{(text || owner) && (
|
||||||
)}
|
<SearchBar initialValue={(text || owner) as string} />
|
||||||
<div className={styles.row}>
|
)}
|
||||||
<PriceFilter
|
<div className={styles.row}>
|
||||||
priceType={price}
|
<PriceFilter
|
||||||
serviceType={service}
|
priceType={price}
|
||||||
setPriceType={setPriceType}
|
serviceType={service}
|
||||||
setServiceType={setServiceType}
|
setPriceType={setPriceType}
|
||||||
/>
|
setServiceType={setServiceType}
|
||||||
<Sort
|
/>
|
||||||
sortType={sortType}
|
<Sort
|
||||||
sortDirection={sortDirection}
|
sortType={sortType}
|
||||||
setSortType={setSortType}
|
sortDirection={sortDirection}
|
||||||
setSortDirection={setSortDirection}
|
setSortType={setSortType}
|
||||||
setPriceType={setPriceType}
|
setSortDirection={setSortDirection}
|
||||||
setServiceType={setServiceType}
|
setPriceType={setPriceType}
|
||||||
/>
|
setServiceType={setServiceType}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className={styles.results}>
|
||||||
<div className={styles.results}>
|
{loading ? (
|
||||||
{loading ? (
|
<Loader />
|
||||||
<Loader />
|
) : queryResult ? (
|
||||||
) : queryResult ? (
|
<AssetList
|
||||||
<AssetList
|
assets={queryResult.results}
|
||||||
assets={queryResult.results}
|
showPagination
|
||||||
showPagination
|
page={queryResult.page}
|
||||||
page={queryResult.page}
|
totalPages={queryResult.totalPages}
|
||||||
totalPages={queryResult.totalPages}
|
onPageChange={setPage}
|
||||||
onPageChange={setPage}
|
/>
|
||||||
/>
|
) : (
|
||||||
) : (
|
''
|
||||||
''
|
)}
|
||||||
)}
|
</div>
|
||||||
</div>
|
</>
|
||||||
</>
|
</Permission>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user