Sort by close date

This commit is contained in:
jahooma 2022-01-23 13:34:03 -06:00
parent b9a82b652e
commit c5a5869f21
2 changed files with 4 additions and 0 deletions

View File

@ -226,6 +226,8 @@ export function SearchableGrid(props: {
matches,
(contract) => -1 * (contract.resolutionTime ?? 0)
)
} else if (sort === 'close-date') {
matches = _.sortBy(matches, (contract) => contract.closeTime)
} else if (sort === 'most-traded') {
matches.sort(
(a, b) => contractMetrics(b).truePool - contractMetrics(a).truePool
@ -266,6 +268,7 @@ export function SearchableGrid(props: {
<option value="most-traded">Most traded</option>
<option value="newest">Newest</option>
<option value="resolved">Resolved</option>
<option value="close-date">Close date</option>
</select>
</div>

View File

@ -5,6 +5,7 @@ export type Sort =
| 'tag'
| 'newest'
| 'most-traded'
| 'close-date'
| 'resolved'
| 'all'