Don't show creator avatar url, for now

This commit is contained in:
Austin Chen 2022-01-10 02:02:13 -05:00
parent e14970dc70
commit f702e55214
4 changed files with 9 additions and 10 deletions

View File

@ -62,12 +62,11 @@ export function parseRequest(req: IncomingMessage) {
question: question:
getString(question) || "Will you create a prediction market on Manifold?", getString(question) || "Will you create a prediction market on Manifold?",
probability: getString(probability) || "85", probability: getString(probability) || "85%",
metadata: getString(metadata) || "Jan 1  •  M$ 123 pool", metadata: getString(metadata) || "Jan 1  •  M$ 123 pool",
creatorName: getString(creatorName) || "Manifold Markets", creatorName: getString(creatorName) || "Manifold Markets",
creatorUsername: getString(creatorUsername) || "ManifoldMarkets", creatorUsername: getString(creatorUsername) || "ManifoldMarkets",
creatorAvatarUrl: creatorAvatarUrl: getString(creatorAvatarUrl) || "",
getString(creatorAvatarUrl) || "https://manifold.markets/logo.png",
}; };
parsedRequest.images = getDefaultImages(parsedRequest.images); parsedRequest.images = getDefaultImages(parsedRequest.images);
return parsedRequest; return parsedRequest;

View File

@ -93,6 +93,7 @@ export function getHtml(parsedReq: ParsedRequest) {
creatorUsername, creatorUsername,
creatorAvatarUrl, creatorAvatarUrl,
} = parsedReq; } = parsedReq;
const hideAvatar = creatorAvatarUrl ? "" : "hidden";
return `<!DOCTYPE html> return `<!DOCTYPE html>
<html> <html>
<head> <head>
@ -110,11 +111,11 @@ export function getHtml(parsedReq: ParsedRequest) {
<div class="absolute left-24 top-8"> <div class="absolute left-24 top-8">
<div class="flex flex-row align-bottom gap-6"> <div class="flex flex-row align-bottom gap-6">
<img <img
class="h-24 w-24 rounded-full bg-white flex items-center justify-center" class="h-24 w-24 rounded-full bg-white flex items-center justify-center ${hideAvatar}"
src="${creatorAvatarUrl}" src="${creatorAvatarUrl}"
alt="" alt=""
/> />
<div class="flex flex-col"> <div class="flex flex-col gap-2">
<p class="text-gray-900 text-3xl">${creatorName}</p> <p class="text-gray-900 text-3xl">${creatorName}</p>
<p class="text-gray-500 text-3xl">@${creatorUsername}</p> <p class="text-gray-500 text-3xl">@${creatorUsername}</p>
</div> </div>
@ -139,7 +140,7 @@ export function getHtml(parsedReq: ParsedRequest) {
</div> </div>
<div class="flex flex-row justify-between gap-12 pt-36"> <div class="flex flex-row justify-between gap-12 pt-36">
<div class="text-indigo-700 text-6xl leading-snug"> <div class="text-indigo-700 text-6xl leading-tight">
${question} ${question}
</div> </div>
<div class="flex flex-col text-primary"> <div class="flex flex-col text-primary">

View File

@ -6,7 +6,8 @@ export type OgCardProps = {
metadata: string metadata: string
creatorName: string creatorName: string
creatorUsername: string creatorUsername: string
creatorAvatarUrl: string // TODO: Store creator avatar url in each contract, then enable this
// creatorAvatarUrl: string
} }
function buildCardUrl(props: OgCardProps) { function buildCardUrl(props: OgCardProps) {
@ -17,8 +18,7 @@ function buildCardUrl(props: OgCardProps) {
`&probability=${encodeURIComponent(props.probability)}` + `&probability=${encodeURIComponent(props.probability)}` +
`&metadata=${encodeURIComponent(props.metadata)}` + `&metadata=${encodeURIComponent(props.metadata)}` +
`&creatorName=${encodeURIComponent(props.creatorName)}` + `&creatorName=${encodeURIComponent(props.creatorName)}` +
`&creatorUsername=${encodeURIComponent(props.creatorUsername)}` + `&creatorUsername=${encodeURIComponent(props.creatorUsername)}`
`&creatorAvatarUrl=${encodeURIComponent(props.creatorAvatarUrl)}`
) )
} }

View File

@ -71,7 +71,6 @@ export default function ContractPage(props: {
creatorName: contract.creatorName, creatorName: contract.creatorName,
creatorUsername: contract.creatorUsername, creatorUsername: contract.creatorUsername,
// TODO: replace with actual avatar url // TODO: replace with actual avatar url
creatorAvatarUrl: `https://avatars.dicebear.com/v2/identicon/${contract.creatorUsername}.svg`,
} }
return ( return (