Round bet amounts in feed

This commit is contained in:
jahooma 2022-01-04 09:55:34 -06:00
parent 583dc10e6a
commit db1543ea71

View File

@ -6,8 +6,6 @@ import {
CheckIcon, CheckIcon,
LockClosedIcon, LockClosedIcon,
StarIcon, StarIcon,
ThumbDownIcon,
ThumbUpIcon,
UserIcon, UserIcon,
UsersIcon, UsersIcon,
XIcon, XIcon,
@ -24,6 +22,7 @@ import { Linkify } from './linkify'
import { Row } from './layout/row' import { Row } from './layout/row'
import { createComment } from '../lib/firebase/comments' import { createComment } from '../lib/firebase/comments'
import { useComments } from '../hooks/use-comments' import { useComments } from '../hooks/use-comments'
import { formatMoney } from '../lib/util/format'
dayjs.extend(relativeTime) dayjs.extend(relativeTime)
function FeedComment(props: { activityItem: any }) { function FeedComment(props: { activityItem: any }) {
@ -99,7 +98,7 @@ function FeedBet(props: { activityItem: any }) {
<span className="text-gray-900"> <span className="text-gray-900">
{isCreator ? 'You' : 'A trader'} {isCreator ? 'You' : 'A trader'}
</span>{' '} </span>{' '}
placed M$ {amount} on <OutcomeLabel outcome={outcome} />{' '} placed {formatMoney(amount)} on <OutcomeLabel outcome={outcome} />{' '}
<Timestamp time={createdTime} /> <Timestamp time={createdTime} />
{isCreator && ( {isCreator && (
// Allow user to comment in an textarea if they are the creator // Allow user to comment in an textarea if they are the creator
@ -372,7 +371,7 @@ function FeedBetGroup(props: { activityItem: any }) {
.reduce((acc, bet) => acc + bet.amount, 0) .reduce((acc, bet) => acc + bet.amount, 0)
const yesSpan = yesAmount ? ( const yesSpan = yesAmount ? (
<span> <span>
M$ {yesAmount} on <OutcomeLabel outcome={'YES'} /> {formatMoney(yesAmount)} on <OutcomeLabel outcome={'YES'} />
</span> </span>
) : null ) : null
const noAmount = bets const noAmount = bets
@ -380,7 +379,7 @@ function FeedBetGroup(props: { activityItem: any }) {
.reduce((acc, bet) => acc + bet.amount, 0) .reduce((acc, bet) => acc + bet.amount, 0)
const noSpan = noAmount ? ( const noSpan = noAmount ? (
<span> <span>
M$ {noAmount} on <OutcomeLabel outcome={'NO'} /> {formatMoney(noAmount)} on <OutcomeLabel outcome={'NO'} />
</span> </span>
) : null ) : null
const traderCount = bets.length const traderCount = bets.length