Skip to content

Commit

Permalink
chore: change anemoy status
Browse files Browse the repository at this point in the history
  • Loading branch information
JP Angelle committed Sep 18, 2023
1 parent 955d727 commit 1ba84fc
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
2 changes: 1 addition & 1 deletion centrifuge-app/src/components/PoolCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function PoolCard({
})
: '—'}
</Ellipsis>
{status === 'Upcoming' ? <Text variant="body3"> target</Text> : ''}
{status === 'Upcoming' && apr ? <Text variant="body3"> target</Text> : ''}
</TextWithPlaceholder>

<Box>
Expand Down
12 changes: 10 additions & 2 deletions centrifuge-app/src/components/PoolList.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import { Box, Stack } from '@centrifuge/fabric'
import * as React from 'react'
import styled from 'styled-components'
import { PoolCard, PoolCardProps } from './PoolCard'
import { PoolStatusKey } from './PoolCard/PoolStatus'

type PoolListProps = {
pools: PoolCardProps[]
isLoading?: boolean
}

const PoolCardBox = styled<typeof Box & { status?: PoolStatusKey }>(Box)`
&:hover {
cursor: ${(props) => (props.status === 'Upcoming' ? 'not-allowed' : 'default')};
}
`

export function PoolList({ pools, isLoading }: PoolListProps) {
return (
<Stack as="ul" role="list" gap={1} minWidth={970} py={1}>
Expand All @@ -19,9 +27,9 @@ export function PoolList({ pools, isLoading }: PoolListProps) {
</Box>
))
: pools.map((pool) => (
<Box as="li" key={pool.poolId}>
<PoolCardBox as="li" key={pool.poolId} status={pool.status}>
<PoolCard {...pool} />
</Box>
</PoolCardBox>
))}
</Stack>
)
Expand Down
25 changes: 23 additions & 2 deletions centrifuge-app/src/pages/Pools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function PoolsPage() {
function Pools() {
const cent = useCentrifuge()
const { search } = useLocation()
const [listedPools, _listedTokens, metadataIsLoading] = useListedPools()
const [listedPools, , metadataIsLoading] = useListedPools()

const centPools = listedPools.filter(({ id }) => !id.startsWith('0x')) as Pool[]
const centPoolsMetaData: PoolMetaDataPartial[] = useMetadataMulti<PoolMetadata>(
Expand All @@ -57,7 +57,28 @@ function Pools() {
]

const pools = !!listedPools?.length
? [...upcomingPools, ...poolsToPoolCardProps(listedPools, centPoolsMetaDataById, cent)]
? [
...upcomingPools,
...poolsToPoolCardProps(listedPools, centPoolsMetaDataById, cent).map((pool) => {
if (pool.name?.includes('Anemoy Liquid Treasury Fund')) {
return {
...pool,
status: 'Upcoming' as PoolStatusKey,
apr: Rate.fromApr(0.05),
}
}

return pool
}),
].sort((a, b) => {
if (a.status === 'Upcoming') {
return -1
}
if (b.status === 'Upcoming') {
return 1
}
return 0
})
: [...upcomingPools]
const filteredPools = !!pools?.length ? filterPools(pools, new URLSearchParams(search)) : []

Expand Down

0 comments on commit 1ba84fc

Please sign in to comment.