Fix down triangle & padding
This commit is contained in:
parent
ba9411161d
commit
1cfbd86bd0
|
@ -27,8 +27,8 @@ import {
|
||||||
import { getOutcomeProbability, getTopAnswer } from 'common/calculate'
|
import { getOutcomeProbability, getTopAnswer } from 'common/calculate'
|
||||||
import { AvatarDetails, MiscDetails } from './contract-details'
|
import { AvatarDetails, MiscDetails } from './contract-details'
|
||||||
import { getExpectedValue, getValueFromBucket } from 'common/calculate-dpm'
|
import { getExpectedValue, getValueFromBucket } from 'common/calculate-dpm'
|
||||||
import TriangleIcon from 'web/lib/icons/triangle-icon'
|
|
||||||
import TriangleFillIcon from 'web/lib/icons/triangle-fill-icon'
|
import TriangleFillIcon from 'web/lib/icons/triangle-fill-icon'
|
||||||
|
import TriangleDownFillIcon from 'web/lib/icons/triangle-down-fill-icon'
|
||||||
|
|
||||||
// Return a number from 0 to 1 for this contract
|
// Return a number from 0 to 1 for this contract
|
||||||
// Resolved contracts are set to 1, for coloring purposes (even if NO)
|
// Resolved contracts are set to 1, for coloring purposes (even if NO)
|
||||||
|
@ -94,7 +94,7 @@ export function ContractCard(props: {
|
||||||
<div>
|
<div>
|
||||||
<Col
|
<Col
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'relative gap-3 rounded-lg bg-white py-4 pl-6 pr-7 shadow-md hover:cursor-pointer hover:bg-gray-100',
|
'relative gap-3 rounded-lg bg-white py-4 pl-6 pr-7 shadow-md hover:bg-gray-100',
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
@ -126,22 +126,24 @@ export function ContractCard(props: {
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
<Col className="relative -my-4 justify-center gap-2">
|
<Col className="relative -my-4 justify-center gap-2">
|
||||||
<div
|
<div className="mt-4">
|
||||||
className="peer absolute top-0 -left-4 -right-7 h-[50%]"
|
<div
|
||||||
onClick={(e) => {
|
className="peer absolute top-0 -left-4 -right-7 h-[50%]"
|
||||||
// console.log('e', e)
|
onClick={(e) => {
|
||||||
}}
|
// console.log('e', e)
|
||||||
></div>
|
}}
|
||||||
{contract.createdTime % 3 == 0 ? (
|
></div>
|
||||||
<TriangleFillIcon
|
{contract.createdTime % 3 == 0 ? (
|
||||||
className={clsx(
|
<TriangleFillIcon
|
||||||
'mx-auto h-5 w-5 peer-hover:text-opacity-60',
|
className={clsx(
|
||||||
`text-${color}`
|
'mx-auto h-5 w-5 peer-hover:text-opacity-60',
|
||||||
)}
|
`text-${color}`
|
||||||
/>
|
)}
|
||||||
) : (
|
/>
|
||||||
<TriangleFillIcon className="mx-auto h-5 w-5 text-gray-200 peer-hover:text-gray-400" />
|
) : (
|
||||||
)}
|
<TriangleFillIcon className="mx-auto h-5 w-5 text-gray-200 peer-hover:text-gray-400" />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
{outcomeType === 'BINARY' && (
|
{outcomeType === 'BINARY' && (
|
||||||
<BinaryResolutionOrChance
|
<BinaryResolutionOrChance
|
||||||
|
@ -165,23 +167,22 @@ export function ContractCard(props: {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div>
|
<div className="mb-4">
|
||||||
<div
|
<div
|
||||||
className="peer absolute bottom-0 -left-4 -right-7 h-[50%]"
|
className="peer absolute bottom-0 -left-4 -right-7 h-[50%]"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
// console.log('e2', e)
|
// console.log('e2', e)
|
||||||
}}
|
}}
|
||||||
></div>
|
></div>
|
||||||
{/* Note: Something about rotate-180 screws with the hitbox. Rotate the SVG instead. */}
|
|
||||||
{contract.createdTime % 3 == 2 ? (
|
{contract.createdTime % 3 == 2 ? (
|
||||||
<TriangleFillIcon
|
<TriangleDownFillIcon
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'mx-auto h-5 w-5 rotate-180 peer-hover:text-opacity-60',
|
'mx-auto h-5 w-5 peer-hover:text-opacity-60',
|
||||||
`text-${color}`
|
`text-${color}`
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<TriangleFillIcon className="mx-auto h-5 w-5 rotate-180 text-gray-200 peer-hover:text-gray-400" />
|
<TriangleDownFillIcon className="mx-auto h-5 w-5 text-gray-200 peer-hover:text-gray-400" />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
17
web/lib/icons/triangle-down-fill-icon.tsx
Normal file
17
web/lib/icons/triangle-down-fill-icon.tsx
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
// Icon from Bootstrap: https://icons.getbootstrap.com/
|
||||||
|
export default function TriangleDownFillIcon(props: { className?: string }) {
|
||||||
|
return (
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
fill="currentColor"
|
||||||
|
className={props.className}
|
||||||
|
viewBox="0 0 16 16"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
fill-rule="evenodd"
|
||||||
|
transform="rotate(-180 8 8)"
|
||||||
|
d="M7.022 1.566a1.13 1.13 0 0 1 1.96 0l6.857 11.667c.457.778-.092 1.767-.98 1.767H1.144c-.889 0-1.437-.99-.98-1.767L7.022 1.566z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
)
|
||||||
|
}
|
|
@ -1,13 +0,0 @@
|
||||||
// Icon from Bootstrap: https://icons.getbootstrap.com/
|
|
||||||
export default function TriangleIcon(props: { className?: string }) {
|
|
||||||
return (
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
fill="currentColor"
|
|
||||||
className={props.className}
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
>
|
|
||||||
<path d="M7.938 2.016A.13.13 0 0 1 8.002 2a.13.13 0 0 1 .063.016.146.146 0 0 1 .054.057l6.857 11.667c.036.06.035.124.002.183a.163.163 0 0 1-.054.06.116.116 0 0 1-.066.017H1.146a.115.115 0 0 1-.066-.017.163.163 0 0 1-.054-.06.176.176 0 0 1 .002-.183L7.884 2.073a.147.147 0 0 1 .054-.057zm1.044-.45a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566z" />
|
|
||||||
</svg>
|
|
||||||
)
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user