From 4503a5e04a41ac8c1e18da5138fc58eb385dea34 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Thu, 16 Dec 2021 15:20:49 -0600 Subject: [PATCH] display active contracts first --- web/components/contracts-list.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/components/contracts-list.tsx b/web/components/contracts-list.tsx index c5d0e9d0..028fc66e 100644 --- a/web/components/contracts-list.tsx +++ b/web/components/contracts-list.tsx @@ -1,7 +1,9 @@ +import _ from 'lodash' import Link from 'next/link' import clsx from 'clsx' -import { Row } from '../components/layout/row' import { useEffect, useState } from 'react' + +import { Row } from '../components/layout/row' import { compute, Contract, @@ -78,7 +80,12 @@ function ContractCard(props: { contract: Contract }) { } function ContractsGrid(props: { contracts: Contract[] }) { - const { contracts } = props + const [resolvedContracts, activeContracts] = _.partition( + props.contracts, + (c) => c.isResolved + ) + const contracts = [...activeContracts, ...resolvedContracts] + return (