Skip to content

Commit

Permalink
added question constants
Browse files Browse the repository at this point in the history
  • Loading branch information
ingawei committed Sep 17, 2024
1 parent 39b5636 commit 35fe2a0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
14 changes: 12 additions & 2 deletions web/components/bet/bet-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,16 @@ export function BetDialog(props: {
pseudonymColor: string
}
}
questionPseudonym?: string
}) {
const { contract, open, setOpen, trackingLocation, initialOutcome } = props
const {
contract,
open,
setOpen,
trackingLocation,
initialOutcome,
questionPseudonym,
} = props
const { question } = contract

return (
Expand All @@ -51,7 +59,9 @@ export function BetDialog(props: {
)}
>
<Col>
<Subtitle className="!mb-4 !mt-0 !text-xl">{question}</Subtitle>
<Subtitle className="!mb-4 !mt-0 !text-xl">
{questionPseudonym ?? question}
</Subtitle>
<BuyPanel
contract={contract}
onBuySuccess={() => setTimeout(() => setOpen(false), 500)}
Expand Down
5 changes: 4 additions & 1 deletion web/components/elections-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import Link from 'next/link'
import { ConditionalMarkets } from './us-elections/contracts/conditional-market/conditional-markets'
import { ElectionsPageProps } from 'web/public/data/elections-data'

export const ELECTIONS_PARTY_QUESTION_PSEUDONYM =
'Who win the Presidential Election?'

export function USElectionsPage(props: ElectionsPageProps) {
const {
rawPresidencyStateContracts,
Expand Down Expand Up @@ -71,7 +74,7 @@ export function USElectionsPage(props: ElectionsPageProps) {
<PoliticsCard
contract={electionPartyContract}
viewType="BINARY_PARTY"
customTitle="Who win the Presidential Election?"
customTitle={ELECTIONS_PARTY_QUESTION_PSEUDONYM}
includeHead
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {
UserPosition,
} from '../candidates-panel/candidates-user-position'
import { ProbPercentLabel } from 'web/components/outcome-label'
import { ELECTIONS_PARTY_QUESTION_PSEUDONYM } from 'web/components/elections-page'

const politicsBinaryPseudonym = {
YES: {
Expand Down Expand Up @@ -245,6 +246,7 @@ function BinaryPartyAnswer(props: {
contract={contract}
user={user}
initialOutcome={'YES'}
questionPseudonym={ELECTIONS_PARTY_QUESTION_PSEUDONYM}
/>
</Row>
}
Expand Down Expand Up @@ -292,6 +294,7 @@ function BinaryPartyAnswer(props: {
contract={contract}
user={user}
initialOutcome={'NO'}
questionPseudonym={ELECTIONS_PARTY_QUESTION_PSEUDONYM}
/>
</Row>
}
Expand Down Expand Up @@ -354,6 +357,7 @@ function BinaryPartyAnswerSnippet(props: {
user={user}
initialOutcome={isDemocraticParty ? 'NO' : 'YES'}
className="w-20"
questionPseudonym={ELECTIONS_PARTY_QUESTION_PSEUDONYM}
/>

{!resolution && betUp && user && (
Expand All @@ -378,8 +382,9 @@ export function BinaryBetButton(props: {
user?: User | null
initialOutcome?: BinaryOutcomes
className?: string
questionPseudonym?: string
}) {
const { contract, initialOutcome, className } = props
const { contract, initialOutcome, className, questionPseudonym } = props
const user = useUser()
const [open, setOpen] = useState(false)

Expand Down Expand Up @@ -418,6 +423,7 @@ export function BinaryBetButton(props: {
trackingLocation="contract table"
initialOutcome={initialOutcome}
binaryPseudonym={politicsBinaryPseudonym}
questionPseudonym={questionPseudonym}
/>
)}
</>
Expand Down

0 comments on commit 35fe2a0

Please sign in to comment.