Merge branch 'main' of https://github.com/manticmarkets/mantic
This commit is contained in:
commit
41b24d415d
|
@ -115,7 +115,10 @@ export function BetPanel(props: { contract: Contract; className?: string }) {
|
||||||
<Col
|
<Col
|
||||||
className={clsx('bg-gray-100 shadow-md px-8 py-6 rounded-md', className)}
|
className={clsx('bg-gray-100 shadow-md px-8 py-6 rounded-md', className)}
|
||||||
>
|
>
|
||||||
<Title className="!mt-0 whitespace-nowrap" text={`Buy ${betChoice}`} />
|
<Title
|
||||||
|
className="mt-0 whitespace-nowrap text-neutral"
|
||||||
|
text={`Buy ${betChoice}`}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="mt-2 mb-1 text-sm text-gray-500">Outcome</div>
|
<div className="mt-2 mb-1 text-sm text-gray-500">Outcome</div>
|
||||||
<YesNoSelector
|
<YesNoSelector
|
||||||
|
|
|
@ -151,9 +151,10 @@ function MyContractBets(props: { contract: Contract; bets: Bet[] }) {
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<Row className="gap-2 text-gray-500 text-sm">
|
<Row className="gap-2 text-gray-500 text-sm">
|
||||||
<div>
|
<UserLink
|
||||||
<UserLink username={contract.creatorUsername} />
|
name={contract.creatorName}
|
||||||
</div>
|
username={contract.creatorUsername}
|
||||||
|
/>
|
||||||
{resolution && (
|
{resolution && (
|
||||||
<>
|
<>
|
||||||
<div>•</div>
|
<div>•</div>
|
||||||
|
|
|
@ -24,8 +24,8 @@ export function ContractCard(props: {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link href={contractPath(contract)}>
|
<Link href={contractPath(contract)}>
|
||||||
<a>
|
<a className="col-span-1">
|
||||||
<li className="col-span-1 bg-white hover:bg-gray-100 shadow-md rounded-lg divide-y divide-gray-200">
|
<li className="bg-white hover:bg-gray-100 shadow-md rounded-lg divide-y divide-gray-200">
|
||||||
<div className="card">
|
<div className="card">
|
||||||
<div className="card-body p-6">
|
<div className="card-body p-6">
|
||||||
<Row className="justify-between gap-4 mb-2">
|
<Row className="justify-between gap-4 mb-2">
|
||||||
|
@ -102,15 +102,17 @@ export function AbbrContractDetails(props: {
|
||||||
showHotVolume?: boolean
|
showHotVolume?: boolean
|
||||||
}) {
|
}) {
|
||||||
const { contract, showHotVolume } = props
|
const { contract, showHotVolume } = props
|
||||||
const { volume24Hours } = contract
|
const { volume24Hours, creatorName, creatorUsername } = contract
|
||||||
const { truePool } = contractMetrics(contract)
|
const { truePool } = contractMetrics(contract)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Col className={clsx('text-sm text-gray-500 gap-2')}>
|
<Col className={clsx('text-sm text-gray-500 gap-2')}>
|
||||||
<Row className="gap-2 flex-wrap">
|
<Row className="gap-2 flex-wrap">
|
||||||
<div className="whitespace-nowrap">
|
<UserLink
|
||||||
<UserLink username={contract.creatorUsername} />
|
className="whitespace-nowrap"
|
||||||
</div>
|
name={creatorName}
|
||||||
|
username={creatorUsername}
|
||||||
|
/>
|
||||||
<div>•</div>
|
<div>•</div>
|
||||||
{showHotVolume ? (
|
{showHotVolume ? (
|
||||||
<div className="whitespace-nowrap">
|
<div className="whitespace-nowrap">
|
||||||
|
@ -127,7 +129,8 @@ export function AbbrContractDetails(props: {
|
||||||
|
|
||||||
export function ContractDetails(props: { contract: Contract }) {
|
export function ContractDetails(props: { contract: Contract }) {
|
||||||
const { contract } = props
|
const { contract } = props
|
||||||
const { question, description, closeTime } = contract
|
const { question, description, closeTime, creatorName, creatorUsername } =
|
||||||
|
contract
|
||||||
const { truePool, createdDate, resolvedDate } = contractMetrics(contract)
|
const { truePool, createdDate, resolvedDate } = contractMetrics(contract)
|
||||||
|
|
||||||
const tags = parseTags(`${question} ${description}`).map((tag) => `#${tag}`)
|
const tags = parseTags(`${question} ${description}`).map((tag) => `#${tag}`)
|
||||||
|
@ -135,9 +138,11 @@ export function ContractDetails(props: { contract: Contract }) {
|
||||||
return (
|
return (
|
||||||
<Col className="text-sm text-gray-500 gap-2 sm:flex-row sm:flex-wrap">
|
<Col className="text-sm text-gray-500 gap-2 sm:flex-row sm:flex-wrap">
|
||||||
<Row className="gap-2 flex-wrap">
|
<Row className="gap-2 flex-wrap">
|
||||||
<div className="whitespace-nowrap">
|
<UserLink
|
||||||
<UserLink username={contract.creatorUsername} />
|
className="whitespace-nowrap"
|
||||||
</div>
|
name={creatorName}
|
||||||
|
username={creatorUsername}
|
||||||
|
/>
|
||||||
<div className="">•</div>
|
<div className="">•</div>
|
||||||
<div className="whitespace-nowrap">
|
<div className="whitespace-nowrap">
|
||||||
{resolvedDate ? `${createdDate} - ${resolvedDate}` : createdDate}
|
{resolvedDate ? `${createdDate} - ${resolvedDate}` : createdDate}
|
||||||
|
|
|
@ -31,6 +31,7 @@ import { formatMoney } from '../lib/util/format'
|
||||||
import { ResolutionOrChance } from './contract-card'
|
import { ResolutionOrChance } from './contract-card'
|
||||||
import { SiteLink } from './site-link'
|
import { SiteLink } from './site-link'
|
||||||
import { Col } from './layout/col'
|
import { Col } from './layout/col'
|
||||||
|
import { UserLink } from './user-page'
|
||||||
dayjs.extend(relativeTime)
|
dayjs.extend(relativeTime)
|
||||||
|
|
||||||
function FeedComment(props: { activityItem: any }) {
|
function FeedComment(props: { activityItem: any }) {
|
||||||
|
@ -38,7 +39,7 @@ function FeedComment(props: { activityItem: any }) {
|
||||||
const { person, text, amount, outcome, createdTime } = activityItem
|
const { person, text, amount, outcome, createdTime } = activityItem
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="relative">
|
<SiteLink className="relative" href={`/${person.username}`}>
|
||||||
<img
|
<img
|
||||||
className="h-10 w-10 rounded-full bg-gray-400 flex items-center justify-center ring-8 ring-gray-50"
|
className="h-10 w-10 rounded-full bg-gray-400 flex items-center justify-center ring-8 ring-gray-50"
|
||||||
src={person.avatarUrl}
|
src={person.avatarUrl}
|
||||||
|
@ -48,13 +49,15 @@ function FeedComment(props: { activityItem: any }) {
|
||||||
<span className="absolute -bottom-3 -right-2 bg-gray-50 rounded-tl px-0.5 py-px">
|
<span className="absolute -bottom-3 -right-2 bg-gray-50 rounded-tl px-0.5 py-px">
|
||||||
<ChatAltIcon className="h-5 w-5 text-gray-400" aria-hidden="true" />
|
<ChatAltIcon className="h-5 w-5 text-gray-400" aria-hidden="true" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</SiteLink>
|
||||||
<div className="min-w-0 flex-1">
|
<div className="min-w-0 flex-1">
|
||||||
<div>
|
<div>
|
||||||
<p className="mt-0.5 text-sm text-gray-500">
|
<p className="mt-0.5 text-sm text-gray-500">
|
||||||
<a href={person.href} className="font-medium text-gray-900">
|
<UserLink
|
||||||
{person.name}
|
className="text-gray-500"
|
||||||
</a>{' '}
|
username={person.username}
|
||||||
|
name={person.name}
|
||||||
|
/>{' '}
|
||||||
placed {formatMoney(amount)} on <OutcomeLabel outcome={outcome} />{' '}
|
placed {formatMoney(amount)} on <OutcomeLabel outcome={outcome} />{' '}
|
||||||
<Timestamp time={createdTime} />
|
<Timestamp time={createdTime} />
|
||||||
</p>
|
</p>
|
||||||
|
@ -205,6 +208,8 @@ export function ContractDescription(props: {
|
||||||
|
|
||||||
function FeedQuestion(props: { contract: Contract }) {
|
function FeedQuestion(props: { contract: Contract }) {
|
||||||
const { contract } = props
|
const { contract } = props
|
||||||
|
const { creatorName, creatorUsername, createdTime, question, resolution } =
|
||||||
|
contract
|
||||||
const { probPercent } = contractMetrics(contract)
|
const { probPercent } = contractMetrics(contract)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -218,19 +223,23 @@ function FeedQuestion(props: { contract: Contract }) {
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0 flex-1 py-1.5">
|
<div className="min-w-0 flex-1 py-1.5">
|
||||||
<div className="text-sm text-gray-500 mb-2">
|
<div className="text-sm text-gray-500 mb-2">
|
||||||
<span className="text-gray-900">{contract.creatorName}</span> asked{' '}
|
<UserLink
|
||||||
<Timestamp time={contract.createdTime} />
|
className="text-gray-900"
|
||||||
|
name={creatorName}
|
||||||
|
username={creatorUsername}
|
||||||
|
/>{' '}
|
||||||
|
asked <Timestamp time={createdTime} />
|
||||||
</div>
|
</div>
|
||||||
<Col className="items-start sm:flex-row justify-between gap-2 sm:gap-4 mb-4 mr-2">
|
<Col className="items-start sm:flex-row justify-between gap-2 sm:gap-4 mb-4 mr-2">
|
||||||
<SiteLink
|
<SiteLink
|
||||||
href={contractPath(contract)}
|
href={contractPath(contract)}
|
||||||
className="text-lg sm:text-xl text-indigo-700"
|
className="text-lg sm:text-xl text-indigo-700"
|
||||||
>
|
>
|
||||||
{contract.question}
|
{question}
|
||||||
</SiteLink>
|
</SiteLink>
|
||||||
<ResolutionOrChance
|
<ResolutionOrChance
|
||||||
className="items-center"
|
className="items-center"
|
||||||
resolution={contract.resolution}
|
resolution={resolution}
|
||||||
probPercent={probPercent}
|
probPercent={probPercent}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
@ -242,6 +251,7 @@ function FeedQuestion(props: { contract: Contract }) {
|
||||||
|
|
||||||
function FeedDescription(props: { contract: Contract }) {
|
function FeedDescription(props: { contract: Contract }) {
|
||||||
const { contract } = props
|
const { contract } = props
|
||||||
|
const { creatorName, creatorUsername } = contract
|
||||||
const user = useUser()
|
const user = useUser()
|
||||||
const isCreator = user?.id === contract.creatorId
|
const isCreator = user?.id === contract.creatorId
|
||||||
|
|
||||||
|
@ -256,8 +266,12 @@ function FeedDescription(props: { contract: Contract }) {
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0 flex-1 py-1.5">
|
<div className="min-w-0 flex-1 py-1.5">
|
||||||
<div className="text-sm text-gray-500">
|
<div className="text-sm text-gray-500">
|
||||||
<span className="text-gray-900">{contract.creatorName}</span> created
|
<UserLink
|
||||||
this market <Timestamp time={contract.createdTime} />
|
className="text-gray-900"
|
||||||
|
name={creatorName}
|
||||||
|
username={creatorUsername}
|
||||||
|
/>{' '}
|
||||||
|
created this market <Timestamp time={contract.createdTime} />
|
||||||
</div>
|
</div>
|
||||||
<ContractDescription contract={contract} isCreator={isCreator} />
|
<ContractDescription contract={contract} isCreator={isCreator} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -280,6 +294,7 @@ function OutcomeIcon(props: { outcome?: 'YES' | 'NO' | 'CANCEL' }) {
|
||||||
|
|
||||||
function FeedResolve(props: { contract: Contract }) {
|
function FeedResolve(props: { contract: Contract }) {
|
||||||
const { contract } = props
|
const { contract } = props
|
||||||
|
const { creatorName, creatorUsername } = contract
|
||||||
const resolution = contract.resolution || 'CANCEL'
|
const resolution = contract.resolution || 'CANCEL'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -293,8 +308,12 @@ function FeedResolve(props: { contract: Contract }) {
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0 flex-1 py-1.5">
|
<div className="min-w-0 flex-1 py-1.5">
|
||||||
<div className="text-sm text-gray-500">
|
<div className="text-sm text-gray-500">
|
||||||
<span className="text-gray-900">{contract.creatorName}</span> resolved
|
<UserLink
|
||||||
this market to <OutcomeLabel outcome={resolution} />{' '}
|
className="text-gray-900"
|
||||||
|
name={creatorName}
|
||||||
|
username={creatorUsername}
|
||||||
|
/>{' '}
|
||||||
|
resolved this market to <OutcomeLabel outcome={resolution} />{' '}
|
||||||
<Timestamp time={contract.resolutionTime || 0} />
|
<Timestamp time={contract.resolutionTime || 0} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -354,7 +373,7 @@ function toFeedComment(bet: Bet, comment: Comment) {
|
||||||
// Invariant: bet.comment exists
|
// Invariant: bet.comment exists
|
||||||
text: comment.text,
|
text: comment.text,
|
||||||
person: {
|
person: {
|
||||||
href: `/${comment.userUsername}`,
|
username: comment.userUsername,
|
||||||
name: comment.userName,
|
name: comment.userName,
|
||||||
avatarUrl: comment.userAvatarUrl,
|
avatarUrl: comment.userAvatarUrl,
|
||||||
},
|
},
|
||||||
|
|
|
@ -40,7 +40,7 @@ export const ContractOverview = (props: {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Col className={clsx('mb-6', className)}>
|
<Col className={clsx('mb-6', className)}>
|
||||||
<Row className="justify-between gap-4">
|
<Row className="justify-between gap-4 px-2">
|
||||||
<Col className="gap-4">
|
<Col className="gap-4">
|
||||||
<div className="text-2xl md:text-3xl text-indigo-700">
|
<div className="text-2xl md:text-3xl text-indigo-700">
|
||||||
<Linkify text={contract.question} />
|
<Linkify text={contract.question} />
|
||||||
|
|
|
@ -42,7 +42,7 @@ export function ContractsGrid(props: {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ul role="list" className="grid grid-cols-1 gap-6 lg:grid-cols-2">
|
<ul className="w-full grid grid-cols-1 gap-6 md:grid-cols-2">
|
||||||
{contracts.map((contract) => (
|
{contracts.map((contract) => (
|
||||||
<ContractCard
|
<ContractCard
|
||||||
contract={contract}
|
contract={contract}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
|
import Image from 'next/image'
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
|
|
||||||
export function ManifoldLogo(props: { darkBackground?: boolean }) {
|
export function ManifoldLogo(props: { darkBackground?: boolean }) {
|
||||||
|
@ -6,8 +7,8 @@ export function ManifoldLogo(props: { darkBackground?: boolean }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link href="/">
|
<Link href="/">
|
||||||
<a className="flex flex-row gap-4">
|
<a className="flex flex-row gap-4 flex-shrink-0">
|
||||||
<img
|
<Image
|
||||||
className="hover:rotate-12 transition-all"
|
className="hover:rotate-12 transition-all"
|
||||||
src={darkBackground ? '/logo-white.svg' : '/logo.svg'}
|
src={darkBackground ? '/logo-white.svg' : '/logo.svg'}
|
||||||
width={45}
|
width={45}
|
||||||
|
|
|
@ -9,10 +9,7 @@ export function MenuButton(props: {
|
||||||
}) {
|
}) {
|
||||||
const { buttonContent, menuItems, className } = props
|
const { buttonContent, menuItems, className } = props
|
||||||
return (
|
return (
|
||||||
<Menu
|
<Menu as="div" className={clsx('flex-shrink-0 relative z-10', className)}>
|
||||||
as="div"
|
|
||||||
className={clsx('flex-shrink-0 relative ml-4 z-10', className)}
|
|
||||||
>
|
|
||||||
<div>
|
<div>
|
||||||
<Menu.Button className="rounded-full flex">
|
<Menu.Button className="rounded-full flex">
|
||||||
<span className="sr-only">Open user menu</span>
|
<span className="sr-only">Open user menu</span>
|
||||||
|
|
|
@ -10,11 +10,9 @@ import { ProfileMenu } from './profile-menu'
|
||||||
export function NavBar(props: {
|
export function NavBar(props: {
|
||||||
darkBackground?: boolean
|
darkBackground?: boolean
|
||||||
wide?: boolean
|
wide?: boolean
|
||||||
isLandingPage?: boolean
|
|
||||||
className?: string
|
className?: string
|
||||||
children?: any
|
|
||||||
}) {
|
}) {
|
||||||
const { darkBackground, wide, isLandingPage, className, children } = props
|
const { darkBackground, wide, className } = props
|
||||||
|
|
||||||
const user = useUser()
|
const user = useUser()
|
||||||
|
|
||||||
|
@ -27,44 +25,14 @@ export function NavBar(props: {
|
||||||
<Row
|
<Row
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'justify-between items-center mx-auto sm:px-4',
|
'justify-between items-center mx-auto sm:px-4',
|
||||||
isLandingPage ? 'max-w-7xl' : wide ? 'max-w-6xl' : 'max-w-4xl'
|
wide ? 'max-w-6xl' : 'max-w-4xl'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<ManifoldLogo darkBackground={darkBackground} />
|
<ManifoldLogo darkBackground={darkBackground} />
|
||||||
|
|
||||||
<Row className="items-center gap-6 sm:gap-8 md:ml-16 lg:ml-40">
|
<Row className="items-center gap-6 sm:gap-8 ml-6">
|
||||||
{children}
|
{(user || user === null) && (
|
||||||
|
<NavOptions user={user} themeClasses={themeClasses} />
|
||||||
{!user && (
|
|
||||||
<Link href="/about">
|
|
||||||
<a
|
|
||||||
className={clsx(
|
|
||||||
'text-base hidden md:block whitespace-nowrap',
|
|
||||||
themeClasses
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
About
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{!isLandingPage && (
|
|
||||||
<Link href="/markets">
|
|
||||||
<a
|
|
||||||
className={clsx(
|
|
||||||
'text-base hidden md:block whitespace-nowrap',
|
|
||||||
themeClasses
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
All markets
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{user ? (
|
|
||||||
<SignedInHeaders user={user} themeClasses={themeClasses} />
|
|
||||||
) : (
|
|
||||||
<SignedOutHeaders themeClasses={themeClasses} />
|
|
||||||
)}
|
)}
|
||||||
</Row>
|
</Row>
|
||||||
</Row>
|
</Row>
|
||||||
|
@ -72,41 +40,62 @@ export function NavBar(props: {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function SignedInHeaders(props: { user: User; themeClasses?: string }) {
|
function NavOptions(props: { user: User | null; themeClasses: string }) {
|
||||||
const { user, themeClasses } = props
|
const { user, themeClasses } = props
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Link href="/create">
|
{user === null && (
|
||||||
|
<Link href="/about">
|
||||||
|
<a
|
||||||
|
className={clsx(
|
||||||
|
'text-base hidden md:block whitespace-nowrap',
|
||||||
|
themeClasses
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
About
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<Link href="/markets">
|
||||||
<a
|
<a
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'text-base hidden md:block whitespace-nowrap',
|
'text-base hidden md:block whitespace-nowrap',
|
||||||
themeClasses
|
themeClasses
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
Create a market
|
All markets
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<ProfileMenu user={user} />
|
{user === null ? (
|
||||||
</>
|
<>
|
||||||
)
|
<div
|
||||||
}
|
className={clsx(
|
||||||
|
'text-base font-medium cursor-pointer whitespace-nowrap',
|
||||||
function SignedOutHeaders(props: { themeClasses?: string }) {
|
themeClasses
|
||||||
const { themeClasses } = props
|
)}
|
||||||
|
onClick={firebaseLogin}
|
||||||
return (
|
>
|
||||||
<>
|
Sign in
|
||||||
<div
|
</div>
|
||||||
className={clsx(
|
</>
|
||||||
'text-base font-medium cursor-pointer whitespace-nowrap',
|
) : (
|
||||||
themeClasses
|
<>
|
||||||
)}
|
<Link href="/create">
|
||||||
onClick={firebaseLogin}
|
<a
|
||||||
>
|
className={clsx(
|
||||||
Sign in
|
'text-base hidden md:block whitespace-nowrap',
|
||||||
</div>
|
themeClasses
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
Create a market
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
|
||||||
|
<ProfileMenu user={user} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,10 +51,6 @@ function getNavigationOptions(user: User, options: { mobile: boolean }) {
|
||||||
name: 'Your markets',
|
name: 'Your markets',
|
||||||
href: `/${user.username}`,
|
href: `/${user.username}`,
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// name: 'Add funds',
|
|
||||||
// href: '/add-funds',
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
name: 'Discord',
|
name: 'Discord',
|
||||||
href: 'https://discord.gg/eHQBNBqXuh',
|
href: 'https://discord.gg/eHQBNBqXuh',
|
||||||
|
|
|
@ -60,7 +60,7 @@ export function ResolutionPanel(props: {
|
||||||
<Col
|
<Col
|
||||||
className={clsx('bg-gray-100 shadow-md px-8 py-6 rounded-md', className)}
|
className={clsx('bg-gray-100 shadow-md px-8 py-6 rounded-md', className)}
|
||||||
>
|
>
|
||||||
<Title className="mt-0" text="Your market" />
|
<Title className="mt-0 text-neutral" text="Your market" />
|
||||||
|
|
||||||
<div className="pt-2 pb-1 text-sm text-gray-500">Resolve outcome</div>
|
<div className="pt-2 pb-1 text-sm text-gray-500">Resolve outcome</div>
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,18 @@ import { SEO } from './SEO'
|
||||||
import { Page } from './page'
|
import { Page } from './page'
|
||||||
import { SiteLink } from './site-link'
|
import { SiteLink } from './site-link'
|
||||||
|
|
||||||
export function UserLink(props: { username: string; className?: string }) {
|
export function UserLink(props: {
|
||||||
const { username, className } = props
|
name: string
|
||||||
|
username: string
|
||||||
|
showUsername?: boolean
|
||||||
|
className?: string
|
||||||
|
}) {
|
||||||
|
const { name, username, showUsername, className } = props
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SiteLink href={`/${username}`} className={className}>
|
<SiteLink href={`/${username}`} className={className}>
|
||||||
@{username}
|
{name}
|
||||||
|
{showUsername && ` (@${username})`}
|
||||||
</SiteLink>
|
</SiteLink>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,8 +119,13 @@ function BetsSection(props: { contract: Contract; user: User | null }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Title text="Your trades" />
|
<Title className="px-2" text="Your trades" />
|
||||||
<MyBetsSummary contract={contract} bets={userBets} showMKT />
|
<MyBetsSummary
|
||||||
|
className="px-2"
|
||||||
|
contract={contract}
|
||||||
|
bets={userBets}
|
||||||
|
showMKT
|
||||||
|
/>
|
||||||
<Spacer h={6} />
|
<Spacer h={6} />
|
||||||
<ContractBetsTable contract={contract} bets={userBets} />
|
<ContractBetsTable contract={contract} bets={userBets} />
|
||||||
<Spacer h={12} />
|
<Spacer h={12} />
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import { useUser } from '../hooks/use-user'
|
|
||||||
import {
|
import {
|
||||||
Contract,
|
Contract,
|
||||||
getHotContracts,
|
getHotContracts,
|
||||||
listAllContracts,
|
listAllContracts,
|
||||||
} from '../lib/firebase/contracts'
|
} from '../lib/firebase/contracts'
|
||||||
import LandingPage from './landing-page'
|
|
||||||
import { ContractsGrid } from '../components/contracts-list'
|
import { ContractsGrid } from '../components/contracts-list'
|
||||||
import { Spacer } from '../components/layout/spacer'
|
import { Spacer } from '../components/layout/spacer'
|
||||||
import { Page } from '../components/page'
|
import { Page } from '../components/page'
|
||||||
|
@ -37,16 +35,8 @@ const Home = (props: {
|
||||||
hotContracts: Contract[]
|
hotContracts: Contract[]
|
||||||
recentComments: Comment[]
|
recentComments: Comment[]
|
||||||
}) => {
|
}) => {
|
||||||
const user = useUser()
|
|
||||||
|
|
||||||
if (user === undefined) return <></>
|
|
||||||
|
|
||||||
const { contracts, hotContracts, recentComments } = props
|
const { contracts, hotContracts, recentComments } = props
|
||||||
|
|
||||||
if (user === null) {
|
|
||||||
return <LandingPage hotContracts={hotContracts} />
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<div className="w-full bg-indigo-50 border-2 border-indigo-100 p-6 rounded-lg shadow-md">
|
<div className="w-full bg-indigo-50 border-2 border-indigo-100 p-6 rounded-lg shadow-md">
|
||||||
|
|
|
@ -34,7 +34,7 @@ const scrollToAbout = () => {
|
||||||
function Hero() {
|
function Hero() {
|
||||||
return (
|
return (
|
||||||
<div className="overflow-hidden h-screen bg-world-trading bg-cover bg-gray-900 bg-center lg:bg-left">
|
<div className="overflow-hidden h-screen bg-world-trading bg-cover bg-gray-900 bg-center lg:bg-left">
|
||||||
<NavBar isLandingPage darkBackground />
|
<NavBar darkBackground />
|
||||||
<main>
|
<main>
|
||||||
<div className="pt-32 sm:pt-8 lg:pt-0 lg:pb-14 lg:overflow-hidden">
|
<div className="pt-32 sm:pt-8 lg:pt-0 lg:pb-14 lg:overflow-hidden">
|
||||||
<div className="mx-auto max-w-7xl lg:px-8 xl:px-0">
|
<div className="mx-auto max-w-7xl lg:px-8 xl:px-0">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user