Skip to content

Commit

Permalink
add "new"
Browse files Browse the repository at this point in the history
  • Loading branch information
Robiquet committed Mar 18, 2024
1 parent e312b1e commit 509c112
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions pages/api/og/generate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,23 @@ export default async function GenerateOgImage(request: NextRequest) {
{ends}
</div>
</div>
<div tw="flex flex-col">
<h2 tw={`font-bold ${"text-3xl"} font-sans`}>Volume:</h2>
<div tw={`flex ${"text-4xl"} -mt-1`} style={{ color: "#ABC1F9" }}>
{formatNumberCompact(Number(volume))} {currencyMetadata?.name}

{Number(volume) > 0 ? (
<div tw="flex flex-col">
<h2 tw={`font-bold ${"text-3xl"} font-sans`}>Volume:</h2>
<div
tw={`flex ${"text-4xl"} -mt-1`}
style={{ color: "#ABC1F9" }}
>
{formatNumberCompact(Number(volume))} {currencyMetadata?.name}
</div>
</div>
</div>
) : (
<div tw="flex flex-col justify-center items-center">
<div tw={`font-bold ${"text-5xl"} font-sans`}>New!</div>
</div>
)}

<div tw="flex ml-auto mt-4">
<img
style={{
Expand Down

0 comments on commit 509c112

Please sign in to comment.