show market tip total
This commit is contained in:
parent
fac87f8e0c
commit
2baae33a77
|
@ -18,9 +18,7 @@ export function ExtraContractActionsRow(props: { contract: Contract }) {
|
|||
return (
|
||||
<Row>
|
||||
<FollowMarketButton contract={contract} user={user} />
|
||||
{user?.id !== contract.creatorId && (
|
||||
<LikeMarketButton contract={contract} user={user} />
|
||||
)}
|
||||
<LikeMarketButton contract={contract} user={user} />
|
||||
<Tooltip text="Share" placement="bottom" noTap noFade>
|
||||
<Button
|
||||
size="sm"
|
||||
|
|
|
@ -17,9 +17,8 @@ export function LikeMarketButton(props: {
|
|||
}) {
|
||||
const { contract, user } = props
|
||||
|
||||
const tips = useMarketTipTxns(contract.id).filter(
|
||||
(txn) => txn.fromId === user?.id
|
||||
)
|
||||
const tips = useMarketTipTxns(contract.id)
|
||||
|
||||
const totalTipped = useMemo(() => {
|
||||
return sum(tips.map((tip) => tip.amount))
|
||||
}, [tips])
|
||||
|
@ -51,6 +50,7 @@ export function LikeMarketButton(props: {
|
|||
userLikedContractIds?.includes(contract.id) ||
|
||||
(!likes && !!contract.likedByUserIds?.includes(user.id)))
|
||||
}
|
||||
disabled={contract.creatorId === user?.id}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -18,14 +18,18 @@ export function TipButton(props: {
|
|||
|
||||
return (
|
||||
<Tooltip
|
||||
text={`Tip ${formatMoney(tipAmount)}`}
|
||||
text={disabled ? 'Tips' : `Tip ${formatMoney(tipAmount)}`}
|
||||
placement="bottom"
|
||||
noTap
|
||||
noFade
|
||||
>
|
||||
<Button
|
||||
size={'sm'}
|
||||
className={clsx('max-w-xs self-center', isCompact && 'px-0 py-0')}
|
||||
className={clsx(
|
||||
'max-w-xs self-center',
|
||||
isCompact && 'px-0 py-0',
|
||||
disabled && 'hover:bg-inherit'
|
||||
)}
|
||||
color={'gray-white'}
|
||||
onClick={onClick}
|
||||
disabled={disabled}
|
||||
|
|
Loading…
Reference in New Issue
Block a user