un-daisy tables
This commit is contained in:
parent
2e39d7b6cc
commit
c3af44d52e
|
@ -53,6 +53,7 @@ import {
|
||||||
import { safeLocalStorage } from 'web/lib/util/local'
|
import { safeLocalStorage } from 'web/lib/util/local'
|
||||||
import { ExclamationIcon } from '@heroicons/react/outline'
|
import { ExclamationIcon } from '@heroicons/react/outline'
|
||||||
import { Select } from './select'
|
import { Select } from './select'
|
||||||
|
import { Table } from './table'
|
||||||
|
|
||||||
type BetSort = 'newest' | 'profit' | 'closeTime' | 'value'
|
type BetSort = 'newest' | 'profit' | 'closeTime' | 'value'
|
||||||
type BetFilter = 'open' | 'limit_bet' | 'sold' | 'closed' | 'resolved' | 'all'
|
type BetFilter = 'open' | 'limit_bet' | 'sold' | 'closed' | 'resolved' | 'all'
|
||||||
|
@ -450,7 +451,7 @@ export function ContractBetsTable(props: {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<table className="table-zebra table-compact table w-full text-gray-500">
|
<Table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr className="p-2">
|
<tr className="p-2">
|
||||||
<th></th>
|
<th></th>
|
||||||
|
@ -479,7 +480,7 @@ export function ContractBetsTable(props: {
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</Table>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import { Row } from '../layout/row'
|
||||||
import { BETTORS, User } from 'common/user'
|
import { BETTORS, User } from 'common/user'
|
||||||
import { Button } from '../button'
|
import { Button } from '../button'
|
||||||
import { AddLiquidityButton } from './add-liquidity-button'
|
import { AddLiquidityButton } from './add-liquidity-button'
|
||||||
|
import { Table } from '../table'
|
||||||
|
|
||||||
export const contractDetailsButtonClassName =
|
export const contractDetailsButtonClassName =
|
||||||
'group flex items-center rounded-md px-3 py-2 text-sm font-medium cursor-pointer hover:bg-gray-100 text-gray-400 hover:text-gray-500'
|
'group flex items-center rounded-md px-3 py-2 text-sm font-medium cursor-pointer hover:bg-gray-100 text-gray-400 hover:text-gray-500'
|
||||||
|
@ -99,8 +100,7 @@ export function ContractInfoDialog(props: {
|
||||||
<Modal open={open} setOpen={setOpen}>
|
<Modal open={open} setOpen={setOpen}>
|
||||||
<Col className="gap-4 rounded bg-white p-6">
|
<Col className="gap-4 rounded bg-white p-6">
|
||||||
<Title className="!mt-0 !mb-0" text="This Market" />
|
<Title className="!mt-0 !mb-0" text="This Market" />
|
||||||
|
<Table>
|
||||||
<table className="table-compact table-zebra table w-full text-gray-500">
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Type</td>
|
<td>Type</td>
|
||||||
|
@ -239,7 +239,7 @@ export function ContractInfoDialog(props: {
|
||||||
</tr>
|
</tr>
|
||||||
)}
|
)}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</Table>
|
||||||
|
|
||||||
<Row className="flex-wrap">
|
<Row className="flex-wrap">
|
||||||
{mechanism === 'cpmm-1' && (
|
{mechanism === 'cpmm-1' && (
|
||||||
|
|
|
@ -2,6 +2,7 @@ import clsx from 'clsx'
|
||||||
import { Avatar } from './avatar'
|
import { Avatar } from './avatar'
|
||||||
import { Row } from './layout/row'
|
import { Row } from './layout/row'
|
||||||
import { SiteLink } from './site-link'
|
import { SiteLink } from './site-link'
|
||||||
|
import { Table } from './table'
|
||||||
import { Title } from './title'
|
import { Title } from './title'
|
||||||
|
|
||||||
interface LeaderboardEntry {
|
interface LeaderboardEntry {
|
||||||
|
@ -31,9 +32,9 @@ export function Leaderboard<T extends LeaderboardEntry>(props: {
|
||||||
<div className="ml-2 text-gray-500">None yet</div>
|
<div className="ml-2 text-gray-500">None yet</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="overflow-x-auto">
|
<div className="overflow-x-auto">
|
||||||
<table className="table-zebra table-compact table w-full text-gray-500">
|
<Table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr className="p-2">
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
{columns.map((column) => (
|
{columns.map((column) => (
|
||||||
|
@ -59,7 +60,7 @@ export function Leaderboard<T extends LeaderboardEntry>(props: {
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</Table>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -14,6 +14,7 @@ import { Row } from './layout/row'
|
||||||
import { LoadingIndicator } from './loading-indicator'
|
import { LoadingIndicator } from './loading-indicator'
|
||||||
import { BinaryOutcomeLabel, PseudoNumericOutcomeLabel } from './outcome-label'
|
import { BinaryOutcomeLabel, PseudoNumericOutcomeLabel } from './outcome-label'
|
||||||
import { Subtitle } from './subtitle'
|
import { Subtitle } from './subtitle'
|
||||||
|
import { Table } from './table'
|
||||||
import { Title } from './title'
|
import { Title } from './title'
|
||||||
|
|
||||||
export function LimitBets(props: {
|
export function LimitBets(props: {
|
||||||
|
@ -74,7 +75,7 @@ export function LimitOrderTable(props: {
|
||||||
const isPseudoNumeric = contract.outcomeType === 'PSEUDO_NUMERIC'
|
const isPseudoNumeric = contract.outcomeType === 'PSEUDO_NUMERIC'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<table className="table-compact table w-full rounded text-gray-500">
|
<Table className="rounded">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{!isYou && <th></th>}
|
{!isYou && <th></th>}
|
||||||
|
@ -89,7 +90,7 @@ export function LimitOrderTable(props: {
|
||||||
<LimitBet key={bet.id} bet={bet} contract={contract} isYou={isYou} />
|
<LimitBet key={bet.id} bet={bet} contract={contract} isYou={isYou} />
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</Table>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
21
web/components/table.tsx
Normal file
21
web/components/table.tsx
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
import clsx from 'clsx'
|
||||||
|
|
||||||
|
/** `<table>` with styles. Expects table html (`<thead>`, `<td>` etc) */
|
||||||
|
export const Table = (props: {
|
||||||
|
zebra?: boolean
|
||||||
|
className?: string
|
||||||
|
children: React.ReactNode
|
||||||
|
}) => {
|
||||||
|
const { className, children } = props
|
||||||
|
|
||||||
|
return (
|
||||||
|
<table
|
||||||
|
className={clsx(
|
||||||
|
'w-full whitespace-nowrap text-left text-sm text-gray-500 [&_td]:p-2 [&_th]:p-2 [&>thead]:font-bold [&>tbody_tr:nth-child(odd)]:bg-white',
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</table>
|
||||||
|
)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user