Truncate image preview to 120 chars
This commit is contained in:
parent
5cb6ee3bca
commit
5606bf665c
|
@ -85,7 +85,6 @@ export function getHtml(parsedReq: ParsedRequest) {
|
||||||
const {
|
const {
|
||||||
theme,
|
theme,
|
||||||
fontSize,
|
fontSize,
|
||||||
|
|
||||||
question,
|
question,
|
||||||
probability,
|
probability,
|
||||||
metadata,
|
metadata,
|
||||||
|
@ -93,6 +92,10 @@ export function getHtml(parsedReq: ParsedRequest) {
|
||||||
creatorUsername,
|
creatorUsername,
|
||||||
creatorAvatarUrl,
|
creatorAvatarUrl,
|
||||||
} = parsedReq
|
} = parsedReq
|
||||||
|
const MAX_QUESTION_CHARS = 120
|
||||||
|
const truncatedQuestion = question.length > MAX_QUESTION_CHARS
|
||||||
|
? question.slice(0, MAX_QUESTION_CHARS) + '...'
|
||||||
|
: question
|
||||||
const hideAvatar = creatorAvatarUrl ? '' : 'hidden'
|
const hideAvatar = creatorAvatarUrl ? '' : 'hidden'
|
||||||
return `<!DOCTYPE html>
|
return `<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
@ -141,7 +144,7 @@ export function getHtml(parsedReq: ParsedRequest) {
|
||||||
|
|
||||||
<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-tight">
|
<div class="text-indigo-700 text-6xl leading-tight">
|
||||||
${question}
|
${truncatedQuestion}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col text-primary">
|
<div class="flex flex-col text-primary">
|
||||||
<div class="text-8xl">${probability}</div>
|
<div class="text-8xl">${probability}</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user