From 7275bbe13156f4385691f8c809ed1667fb2cdd50 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 14 Oct 2020 13:28:51 +0200 Subject: [PATCH] output new liquidity pools --- src/components/pages/Home.tsx | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/components/pages/Home.tsx b/src/components/pages/Home.tsx index 9672f2cb5..5d1a9dbe5 100644 --- a/src/components/pages/Home.tsx +++ b/src/components/pages/Home.tsx @@ -18,6 +18,13 @@ const queryHighest = { sort: { 'price.ocean': -1 } } +const queryPoolsLatest = { + page: 1, + offset: 6, + query: { 'price.type': ['pool'] }, + sort: { created: -1 } +} + const queryLatest = { page: 1, offset: 20, @@ -39,6 +46,9 @@ async function getAssets(query: SearchQuery, metadataCacheUri: string) { export default function HomePage(): ReactElement { const { config } = useOcean() const [queryResultLatest, setQueryResultLatest] = useState() + const [queryResultPoolsLatest, setQueryResultPoolsLatest] = useState< + QueryResult + >() const [queryResultHighest, setQueryResultHighest] = useState() const [loading, setLoading] = useState(true) @@ -50,6 +60,12 @@ export default function HomePage(): ReactElement { ) setQueryResultHighest(queryResultHighest) + const queryResultPoolsLatest = await getAssets( + queryPoolsLatest, + config.metadataCacheUri + ) + setQueryResultPoolsLatest(queryResultPoolsLatest) + const queryResultLatest = await getAssets( queryLatest, config.metadataCacheUri @@ -67,7 +83,7 @@ export default function HomePage(): ReactElement {
-

Highest Liquidity

+

Highest Liquidity Pools

{loading ? ( ) : ( @@ -76,7 +92,18 @@ export default function HomePage(): ReactElement {
-

Latest

+

New Liquidity Pools

+ {loading ? ( + + ) : ( + queryResultPoolsLatest && ( + + ) + )} +
+ +
+

New Data Sets

{loading ? ( ) : (