Also support lowest % first
This commit is contained in:
parent
1f6cab8cb4
commit
9a101601fb
|
@ -61,6 +61,10 @@ export default function ContractSearchFirestore(props: {
|
||||||
matches = sortBy(matches, (c) =>
|
matches = sortBy(matches, (c) =>
|
||||||
getProbability(c as BinaryContract | PseudoNumericContract)
|
getProbability(c as BinaryContract | PseudoNumericContract)
|
||||||
).reverse()
|
).reverse()
|
||||||
|
} else if (sort === 'lowest-percent') {
|
||||||
|
matches = sortBy(matches, (c) =>
|
||||||
|
getProbability(c as BinaryContract | PseudoNumericContract)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (additionalFilter) {
|
if (additionalFilter) {
|
||||||
|
@ -109,12 +113,13 @@ export default function ContractSearchFirestore(props: {
|
||||||
value={sort}
|
value={sort}
|
||||||
onChange={(e) => setSort(e.target.value)}
|
onChange={(e) => setSort(e.target.value)}
|
||||||
>
|
>
|
||||||
<option value="highest-percent">Highest %</option>
|
|
||||||
<option value="score">Trending</option>
|
<option value="score">Trending</option>
|
||||||
<option value="newest">Newest</option>
|
<option value="newest">Newest</option>
|
||||||
<option value="most-traded">Most traded</option>
|
<option value="most-traded">Most traded</option>
|
||||||
<option value="24-hour-vol">24h volume</option>
|
<option value="24-hour-vol">24h volume</option>
|
||||||
<option value="close-date">Closing soon</option>
|
<option value="close-date">Closing soon</option>
|
||||||
|
<option value="highest-percent">Highest %</option>
|
||||||
|
<option value="lowest-percent">Lowest %</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<ContractsGrid contracts={matches} showTime={showTime} />
|
<ContractsGrid contracts={matches} showTime={showTime} />
|
||||||
|
|
Loading…
Reference in New Issue
Block a user