1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 01:34:57 +01:00

output new liquidity pools

This commit is contained in:
Matthias Kretschmann 2020-10-14 13:28:51 +02:00
parent c1a0134c0a
commit 7275bbe131
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -18,6 +18,13 @@ const queryHighest = {
sort: { 'price.ocean': -1 } sort: { 'price.ocean': -1 }
} }
const queryPoolsLatest = {
page: 1,
offset: 6,
query: { 'price.type': ['pool'] },
sort: { created: -1 }
}
const queryLatest = { const queryLatest = {
page: 1, page: 1,
offset: 20, offset: 20,
@ -39,6 +46,9 @@ async function getAssets(query: SearchQuery, metadataCacheUri: string) {
export default function HomePage(): ReactElement { export default function HomePage(): ReactElement {
const { config } = useOcean() const { config } = useOcean()
const [queryResultLatest, setQueryResultLatest] = useState<QueryResult>() const [queryResultLatest, setQueryResultLatest] = useState<QueryResult>()
const [queryResultPoolsLatest, setQueryResultPoolsLatest] = useState<
QueryResult
>()
const [queryResultHighest, setQueryResultHighest] = useState<QueryResult>() const [queryResultHighest, setQueryResultHighest] = useState<QueryResult>()
const [loading, setLoading] = useState(true) const [loading, setLoading] = useState(true)
@ -50,6 +60,12 @@ export default function HomePage(): ReactElement {
) )
setQueryResultHighest(queryResultHighest) setQueryResultHighest(queryResultHighest)
const queryResultPoolsLatest = await getAssets(
queryPoolsLatest,
config.metadataCacheUri
)
setQueryResultPoolsLatest(queryResultPoolsLatest)
const queryResultLatest = await getAssets( const queryResultLatest = await getAssets(
queryLatest, queryLatest,
config.metadataCacheUri config.metadataCacheUri
@ -67,7 +83,7 @@ export default function HomePage(): ReactElement {
</Container> </Container>
<section className={styles.latest}> <section className={styles.latest}>
<h3>Highest Liquidity</h3> <h3>Highest Liquidity Pools</h3>
{loading ? ( {loading ? (
<Loader /> <Loader />
) : ( ) : (
@ -76,7 +92,18 @@ export default function HomePage(): ReactElement {
</section> </section>
<section className={styles.latest}> <section className={styles.latest}>
<h3>Latest</h3> <h3>New Liquidity Pools</h3>
{loading ? (
<Loader />
) : (
queryResultPoolsLatest && (
<AssetList queryResult={queryResultPoolsLatest} />
)
)}
</section>
<section className={styles.latest}>
<h3>New Data Sets</h3>
{loading ? ( {loading ? (
<Loader /> <Loader />
) : ( ) : (