-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change naming * Update pool list view for archived * Update IPFS hash archived pools blockchain tower * Add loader to assets table * Add total assets finance * Update centrifuge-app/src/pages/Pools.tsx Co-authored-by: Onno Visser <[email protected]> * Revert to TVL * fix import --------- Co-authored-by: Onno Visser <[email protected]>
- Loading branch information
1 parent
a393b01
commit 881c9dd
Showing
7 changed files
with
98 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Box, Grid, Text } from '@centrifuge/fabric' | ||
import { useTheme } from 'styled-components' | ||
import { PoolCardProps } from '.' | ||
import { formatBalance, formatPercentage } from '../../../src/utils/formatting' | ||
import { PoolStatus } from './PoolStatus' | ||
|
||
export const PoolListView = ({ | ||
poolId, | ||
assetClass, | ||
valueLocked, | ||
iconUri, | ||
tranches, | ||
name, | ||
currencySymbol, | ||
status, | ||
createdAt, | ||
...pool | ||
}: PoolCardProps) => { | ||
const theme = useTheme() | ||
const calculateApy = () => { | ||
const APR = tranches?.find((tranche) => tranche.interestRatePerSec)?.interestRatePerSec | ||
if (APR) return formatPercentage(APR.toAprPercent(), true, {}, 1) | ||
else return '-' | ||
} | ||
return ( | ||
<Grid | ||
gridTemplateColumns={['24px 1fr 1fr 1fr 70px 70px']} | ||
alignItems="center" | ||
border={`1px solid ${theme.colors.borderPrimary}`} | ||
borderRadius={8} | ||
padding={2} | ||
boxShadow={`0 -1px 0 ${theme.colors.borderPrimary}`} | ||
gap={1} | ||
> | ||
<Box as="img" width="iconMedium" height="iconMedium" src={iconUri} borderRadius={4} /> | ||
<Text variant="body2">{name}</Text> | ||
<Text variant="body2">{assetClass}</Text> | ||
<Text variant="body2">{formatBalance(valueLocked || 0, currencySymbol)}</Text> | ||
<Text>{calculateApy()}</Text> | ||
<PoolStatus status={status} /> | ||
</Grid> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters