Use client side contract search for emulator
This commit is contained in:
parent
d29115b05a
commit
cb68530e2a
|
@ -122,7 +122,7 @@ export function ContractSearch(props: {
|
||||||
|
|
||||||
const indexName = `${indexPrefix}contracts-${sort}`
|
const indexName = `${indexPrefix}contracts-${sort}`
|
||||||
|
|
||||||
if (IS_PRIVATE_MANIFOLD) {
|
if (IS_PRIVATE_MANIFOLD || process.env.NEXT_PUBLIC_FIREBASE_EMULATE) {
|
||||||
return (
|
return (
|
||||||
<ContractSearchFirestore
|
<ContractSearchFirestore
|
||||||
querySortOptions={querySortOptions}
|
querySortOptions={querySortOptions}
|
||||||
|
|
|
@ -74,7 +74,7 @@ export function FreeResponseOutcomeLabel(props: {
|
||||||
if (resolution === 'CANCEL') return <CancelLabel />
|
if (resolution === 'CANCEL') return <CancelLabel />
|
||||||
if (resolution === 'MKT') return <MultiLabel />
|
if (resolution === 'MKT') return <MultiLabel />
|
||||||
|
|
||||||
const chosen = contract.answers.find((answer) => answer.id === resolution)
|
const chosen = contract.answers?.find((answer) => answer.id === resolution)
|
||||||
if (!chosen) return <AnswerNumberLabel number={resolution} />
|
if (!chosen) return <AnswerNumberLabel number={resolution} />
|
||||||
return (
|
return (
|
||||||
<FreeResponseAnswerToolTip text={chosen.text}>
|
<FreeResponseAnswerToolTip text={chosen.text}>
|
||||||
|
|
|
@ -9,6 +9,8 @@ import {
|
||||||
useInitialQueryAndSort,
|
useInitialQueryAndSort,
|
||||||
} from 'web/hooks/use-sort-and-query-params'
|
} from 'web/hooks/use-sort-and-query-params'
|
||||||
|
|
||||||
|
const MAX_CONTRACTS_RENDERED = 100
|
||||||
|
|
||||||
export default function ContractSearchFirestore(props: {
|
export default function ContractSearchFirestore(props: {
|
||||||
querySortOptions?: {
|
querySortOptions?: {
|
||||||
defaultSort: Sort
|
defaultSort: Sort
|
||||||
|
@ -80,6 +82,8 @@ export default function ContractSearchFirestore(props: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
matches = matches.slice(0, MAX_CONTRACTS_RENDERED)
|
||||||
|
|
||||||
const showTime = ['close-date', 'closed'].includes(sort)
|
const showTime = ['close-date', 'closed'].includes(sort)
|
||||||
? 'close-date'
|
? 'close-date'
|
||||||
: sort === 'resolve-date'
|
: sort === 'resolve-date'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user