Linkify bettor username in Bets tab

This commit is contained in:
James Grugett 2022-06-09 15:00:31 -05:00
parent 3858f8fbea
commit 2564eb9c26
2 changed files with 8 additions and 3 deletions

View File

@ -26,7 +26,7 @@ export function Avatar(props: {
return avatarUrl ? ( return avatarUrl ? (
<img <img
className={clsx( className={clsx(
'flex-shrink-0 rounded-full rounded-full bg-white object-cover', 'flex-shrink-0 rounded-full bg-white object-cover',
`w-${s} h-${s}`, `w-${s} h-${s}`,
!noLink && 'cursor-pointer', !noLink && 'cursor-pointer',
className className

View File

@ -13,6 +13,7 @@ import { RelativeTimestamp } from 'web/components/relative-timestamp'
import React, { Fragment } from 'react' import React, { Fragment } from 'react'
import { uniqBy, partition, sumBy, groupBy } from 'lodash' import { uniqBy, partition, sumBy, groupBy } from 'lodash'
import { JoinSpans } from 'web/components/join-spans' import { JoinSpans } from 'web/components/join-spans'
import { UserLink } from '../user-page'
export function FeedBet(props: { export function FeedBet(props: {
contract: Contract contract: Contract
@ -83,8 +84,12 @@ export function BetStatusText(props: {
return ( return (
<div className="text-sm text-gray-500"> <div className="text-sm text-gray-500">
<span>{isSelf ? 'You' : bettor ? bettor.name : 'A trader'}</span> {bought}{' '} {bettor ? (
{money} <UserLink name={bettor.name} username={bettor.username} />
) : (
<span>{isSelf ? 'You' : 'A trader'}</span>
)}{' '}
{bought} {money}
{!hideOutcome && ( {!hideOutcome && (
<> <>
{' '} {' '}