diff --git a/centrifuge-app/src/components/Portfolio/CardPortfolioValue.tsx b/centrifuge-app/src/components/Portfolio/CardPortfolioValue.tsx index bf47fec065..3cd0bd963a 100644 --- a/centrifuge-app/src/components/Portfolio/CardPortfolioValue.tsx +++ b/centrifuge-app/src/components/Portfolio/CardPortfolioValue.tsx @@ -1,17 +1,32 @@ import { Box, Shelf, Stack, Text, TextWithPlaceholder } from '@centrifuge/fabric' import * as React from 'react' -import { useTheme } from 'styled-components' +import styled, { useTheme } from 'styled-components' import { config } from '../../config' import { Dec } from '../../utils/Decimal' import { formatBalance } from '../../utils/formatting' import { useListedPools } from '../../utils/useListedPools' import { DataPoint, PortfolioValue } from './PortfolioValue' +const RangeFilterButton = styled(Stack)` + &:hover { + cursor: pointer; + } +` + +const rangeFilters = [ + { value: '30d', label: '30 days' }, + { value: '90d', label: '90 days' }, + { value: 'ytd', label: 'Year to date' }, + { value: 'all', label: 'All' }, +] as const + export function CardPortfolioValue() { const { colors } = useTheme() const [hovered, setHovered] = React.useState(undefined) const [, listedTokens] = useListedPools() + const [range, setRange] = React.useState<(typeof rangeFilters)[number]>({ value: 'ytd', label: 'Year to date' }) + const chartHeight = 130 const balanceProps = { as: 'strong', @@ -50,22 +65,45 @@ export function CardPortfolioValue() { }} background={colors.backgroundPage} > - + Overview - - - Current portfolio value - - {formatBalance(Dec(totalValueLocked || 0), config.baseCurrency)} - - - - Profit - - {formatBalance(Dec(totalValueLocked || 0), config.baseCurrency)} - - + + + + + Current portfolio value + + {formatBalance(Dec(totalValueLocked || 0), config.baseCurrency)} + + + + Profit + + {formatBalance(Dec(totalValueLocked || 0), config.baseCurrency)} + + + + + + + + + {rangeFilters.map((rangeFilter, index) => ( + <> + setRange(rangeFilter)}> + {rangeFilter.label} + + + {index !== rangeFilters.length - 1 && ( + + )} + + ))} diff --git a/centrifuge-app/src/components/Portfolio/PortfolioValue.tsx b/centrifuge-app/src/components/Portfolio/PortfolioValue.tsx index 86cb63c58d..04f3e063c2 100644 --- a/centrifuge-app/src/components/Portfolio/PortfolioValue.tsx +++ b/centrifuge-app/src/components/Portfolio/PortfolioValue.tsx @@ -23,8 +23,8 @@ export function PortfolioValue({ setHovered }: TotalValueLockedProps) {