Use a blue bar for Numeric types
This commit is contained in:
parent
5d96fdafd6
commit
4c93da3cc0
|
@ -38,9 +38,17 @@ function getProb(contract: Contract) {
|
||||||
? getBinaryProb(contract)
|
? getBinaryProb(contract)
|
||||||
: outcomeType === 'FREE_RESPONSE'
|
: outcomeType === 'FREE_RESPONSE'
|
||||||
? getOutcomeProbability(contract, getTopAnswer(contract)?.id || '')
|
? getOutcomeProbability(contract, getTopAnswer(contract)?.id || '')
|
||||||
|
: outcomeType === 'NUMERIC'
|
||||||
|
? getNumericScale(contract as NumericContract)
|
||||||
: 1 // Should not happen
|
: 1 // Should not happen
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getNumericScale(contract: NumericContract) {
|
||||||
|
const { min, max } = contract
|
||||||
|
const ev = getExpectedValue(contract)
|
||||||
|
return (ev - min) / (max - min)
|
||||||
|
}
|
||||||
|
|
||||||
function getColor(contract: Contract) {
|
function getColor(contract: Contract) {
|
||||||
const { resolution } = contract
|
const { resolution } = contract
|
||||||
if (resolution) {
|
if (resolution) {
|
||||||
|
@ -51,6 +59,9 @@ function getColor(contract: Contract) {
|
||||||
'primary'
|
'primary'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (contract.outcomeType === 'NUMERIC') {
|
||||||
|
return 'blue-400'
|
||||||
|
}
|
||||||
|
|
||||||
const marketClosed = (contract.closeTime || Infinity) < Date.now()
|
const marketClosed = (contract.closeTime || Infinity) < Date.now()
|
||||||
return marketClosed
|
return marketClosed
|
||||||
|
|
Loading…
Reference in New Issue
Block a user