feat: add market duration/age to market list page (#2419)
This commit is contained in:
parent
7d5cc9b080
commit
b28d671975
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user