diff --git a/web/components/bets-list.tsx b/web/components/bets-list.tsx index 7eb9b31c..86919548 100644 --- a/web/components/bets-list.tsx +++ b/web/components/bets-list.tsx @@ -11,6 +11,7 @@ import { Spacer } from './layout/spacer' import { Contract, path } from '../lib/firebase/contracts' import { Row } from './layout/row' import { calculateWinnings, currentValue } from '../lib/calculation/contract' +import { UserLink } from '../pages/account' export function BetsList(props: { user: User }) { const { user } = props @@ -65,7 +66,9 @@ function MyContractBets(props: { contractId: string; bets: Bet[] }) { -
By {contract.creatorName}
+
+ +
{resolution &&
} {resolution === 'YES' && (
Resolved YES
diff --git a/web/components/contracts-list.tsx b/web/components/contracts-list.tsx index 11450e4f..f10ed9d4 100644 --- a/web/components/contracts-list.tsx +++ b/web/components/contracts-list.tsx @@ -2,7 +2,6 @@ import Link from 'next/link' import { Col } from '../components/layout/col' import { Row } from '../components/layout/row' import { useEffect, useState } from 'react' -import { useUser } from '../hooks/use-user' import { compute, Contract, @@ -11,6 +10,7 @@ import { } from '../lib/firebase/contracts' import { formatMoney } from '../lib/util/format' import { User } from '../lib/firebase/users' +import { UserLink } from '../pages/account' export function ContractDetails(props: { contract: Contract }) { const { contract } = props @@ -18,7 +18,9 @@ export function ContractDetails(props: { contract: Contract }) { return ( -
By {contract.creatorName}
+
+ +
{resolvedDate ? `${createdDate} - ${resolvedDate}` : createdDate} diff --git a/web/pages/account.tsx b/web/pages/account.tsx index c1f2a0db..c85f48f8 100644 --- a/web/pages/account.tsx +++ b/web/pages/account.tsx @@ -7,6 +7,26 @@ import { Row } from '../components/layout/row' import { formatMoney } from '../lib/util/format' import { BetsList } from '../components/bets-list' import { Spacer } from '../components/layout/spacer' +import Link from 'next/link' +import clsx from 'clsx' + +export function UserLink(props: { displayName: string; className?: string }) { + const { displayName, className } = props + const username = displayName.replace(/\s+/g, '') + + return ( + + + @{username} + + + ) +} function UserCard(props: { user: User }) { const { user } = props @@ -23,7 +43,10 @@ function UserCard(props: { user: User }) { )}
-

{user?.name}

+

{user?.email}

{formatMoney(user?.balance)}