Add challenge params to parse request
This commit is contained in:
parent
66e00a1bc4
commit
5d02ba3570
|
@ -20,6 +20,10 @@ export function parseRequest(req: IncomingMessage) {
|
|||
creatorName,
|
||||
creatorUsername,
|
||||
creatorAvatarUrl,
|
||||
|
||||
// Challenge attributes:
|
||||
challengeAmount,
|
||||
challengeOutcome,
|
||||
} = query || {}
|
||||
|
||||
if (Array.isArray(fontSize)) {
|
||||
|
@ -67,6 +71,8 @@ export function parseRequest(req: IncomingMessage) {
|
|||
creatorName: getString(creatorName) || 'Manifold Markets',
|
||||
creatorUsername: getString(creatorUsername) || 'ManifoldMarkets',
|
||||
creatorAvatarUrl: getString(creatorAvatarUrl) || '',
|
||||
challengeAmount: getString(challengeAmount),
|
||||
challengeOutcome: getString(challengeOutcome),
|
||||
}
|
||||
parsedRequest.images = getDefaultImages(parsedRequest.images)
|
||||
return parsedRequest
|
||||
|
|
|
@ -128,7 +128,7 @@ export function getHtml(parsedReq: ParsedRequest) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Mantic logo -->
|
||||
<!-- Manifold logo -->
|
||||
<div class="absolute right-24 top-8">
|
||||
<a class="flex flex-row gap-3" href="/"
|
||||
><img
|
||||
|
@ -151,7 +151,7 @@ export function getHtml(parsedReq: ParsedRequest) {
|
|||
</div>
|
||||
<div class="flex flex-col text-primary">
|
||||
<div class="text-8xl">${
|
||||
challengeAmount ? challengeAmount : probability
|
||||
challengeAmount ? 'M$' + challengeAmount : probability
|
||||
}</div>
|
||||
<div class="text-5xl">${
|
||||
challengeOutcome ? 'on' + challengeOutcome : ''
|
||||
|
|
|
@ -18,6 +18,6 @@ export interface ParsedRequest {
|
|||
creatorName: string
|
||||
creatorUsername: string
|
||||
creatorAvatarUrl: string
|
||||
challengeAmount?: string
|
||||
challengeOutcome?: string
|
||||
challengeAmount: string | undefined
|
||||
challengeOutcome: string | undefined
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user