diff --git a/og-image/api/_lib/template.ts b/og-image/api/_lib/template.ts index 5f795c58..1cb47330 100644 --- a/og-image/api/_lib/template.ts +++ b/og-image/api/_lib/template.ts @@ -156,7 +156,9 @@ export function getHtml(parsedReq: ParsedRequest) {
${ challengeOutcome !== '' ? 'on' + challengeOutcome : '' }
-
${probability !== '' ? 'chance' : ''}
+
${ + challengeAmount !== '' && probability !== '' ? 'chance' : '' + }
diff --git a/web/components/SEO.tsx b/web/components/SEO.tsx index 85eceae4..b7a5e67d 100644 --- a/web/components/SEO.tsx +++ b/web/components/SEO.tsx @@ -10,6 +10,11 @@ export type OgCardProps = { creatorAvatarUrl?: string } +type ChallengeCardProps = { + challengeAmount: string + challengeOutcome: string +} + function buildCardUrl(props: OgCardProps, challengeProps?: ChallengeCardProps) { const probabilityParam = props.probability === undefined @@ -36,10 +41,6 @@ function buildCardUrl(props: OgCardProps, challengeProps?: ChallengeCardProps) { challengeUrlParams ) } -type ChallengeCardProps = { - challengeAmount: string - challengeOutcome: string -} export function SEO(props: { title: string diff --git a/web/pages/challenges/[username]/[contractSlug]/[challengeSlug].tsx b/web/pages/challenges/[username]/[contractSlug]/[challengeSlug].tsx index a09cc511..3f143841 100644 --- a/web/pages/challenges/[username]/[contractSlug]/[challengeSlug].tsx +++ b/web/pages/challenges/[username]/[contractSlug]/[challengeSlug].tsx @@ -101,9 +101,9 @@ export default function ChallengePage(props: { const ogCardProps = getOpenGraphProps(contract) ogCardProps.creatorUsername = challenge.creatorUsername + ogCardProps.creatorName = challenge.creatorName ogCardProps.creatorAvatarUrl = challenge.creatorAvatarUrl ogCardProps.question = 'CHALLENGED:' + contract.question - ogCardProps.probability = '' return (