Add challenge params to parse request

This commit is contained in:
Ian Philips 2022-08-01 10:05:03 -06:00
parent 66e00a1bc4
commit 5d02ba3570
3 changed files with 10 additions and 4 deletions

View File

@ -20,6 +20,10 @@ export function parseRequest(req: IncomingMessage) {
creatorName, creatorName,
creatorUsername, creatorUsername,
creatorAvatarUrl, creatorAvatarUrl,
// Challenge attributes:
challengeAmount,
challengeOutcome,
} = query || {} } = query || {}
if (Array.isArray(fontSize)) { if (Array.isArray(fontSize)) {
@ -67,6 +71,8 @@ export function parseRequest(req: IncomingMessage) {
creatorName: getString(creatorName) || 'Manifold Markets', creatorName: getString(creatorName) || 'Manifold Markets',
creatorUsername: getString(creatorUsername) || 'ManifoldMarkets', creatorUsername: getString(creatorUsername) || 'ManifoldMarkets',
creatorAvatarUrl: getString(creatorAvatarUrl) || '', creatorAvatarUrl: getString(creatorAvatarUrl) || '',
challengeAmount: getString(challengeAmount),
challengeOutcome: getString(challengeOutcome),
} }
parsedRequest.images = getDefaultImages(parsedRequest.images) parsedRequest.images = getDefaultImages(parsedRequest.images)
return parsedRequest return parsedRequest

View File

@ -128,7 +128,7 @@ export function getHtml(parsedReq: ParsedRequest) {
</div> </div>
</div> </div>
<!-- Mantic logo --> <!-- Manifold logo -->
<div class="absolute right-24 top-8"> <div class="absolute right-24 top-8">
<a class="flex flex-row gap-3" href="/" <a class="flex flex-row gap-3" href="/"
><img ><img
@ -151,7 +151,7 @@ export function getHtml(parsedReq: ParsedRequest) {
</div> </div>
<div class="flex flex-col text-primary"> <div class="flex flex-col text-primary">
<div class="text-8xl">${ <div class="text-8xl">${
challengeAmount ? challengeAmount : probability challengeAmount ? 'M$' + challengeAmount : probability
}</div> }</div>
<div class="text-5xl">${ <div class="text-5xl">${
challengeOutcome ? 'on' + challengeOutcome : '' challengeOutcome ? 'on' + challengeOutcome : ''

View File

@ -18,6 +18,6 @@ export interface ParsedRequest {
creatorName: string creatorName: string
creatorUsername: string creatorUsername: string
creatorAvatarUrl: string creatorAvatarUrl: string
challengeAmount?: string challengeAmount: string | undefined
challengeOutcome?: string challengeOutcome: string | undefined
} }