feat: add market duration/age to market list page (#2419)

This commit is contained in:
Ciaran McGhie 2022-12-15 13:15:40 +00:00 committed by GitHub
parent 7d5cc9b080
commit b28d671975
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,7 @@ import { Grid } from '../../grid';
import { HealthBar } from '../../health-bar'; import { HealthBar } from '../../health-bar';
import { HealthDialog } from '../../health-dialog'; import { HealthDialog } from '../../health-dialog';
import { Status } from '../../status'; import { Status } from '../../status';
import { formatDistanceToNow } from 'date-fns';
export const MarketList = () => { export const MarketList = () => {
const { data, error, loading } = useMarketsLiquidity(); const { data, error, loading } = useMarketsLiquidity();
@ -285,6 +286,16 @@ export const MarketList = () => {
sortable={false} sortable={false}
cellStyle={{ overflow: 'unset' }} cellStyle={{ overflow: 'unset' }}
/> />
<AgGridColumn
headerName={t('Age')}
field="marketTimestamps.open"
headerTooltip={t('Age of the market')}
valueFormatter={({
value,
}: VegaValueFormatterParams<Market, 'marketTimestamps.open'>) => {
return value ? formatDistanceToNow(new Date(value)) : '-';
}}
/>
</Grid> </Grid>
<HealthDialog <HealthDialog