Skip to content

Commit

Permalink
Update [assetId].tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
r3lays committed Feb 13, 2024
1 parent 5de53ed commit 60be6c3
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions pages/[chain]/asset/[assetId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,14 @@ const IndexPage: NextPage<Props> = ({ assetId, ssr }) => {
? token.token.name
: `${token?.token?.tokenId} - ${token?.token?.collection?.name}`

const base64EncodedImage = btoa(
token?.token?.image || token?.token?.collection?.image || ''
)
const base64EncodedToken = btoa(JSON.stringify(token))

return (
<Layout>
<Head
ogImage={`${process.env.NEXT_PUBLIC_HOST_URL}/api/og/redirect?image=${base64EncodedImage}`}
ogImage={`/api/og/token?token=${encodeURIComponent(
base64EncodedToken
)}`}
title={pageTitle}
description={collection?.description as string}
metatags={
Expand All @@ -242,10 +242,6 @@ const IndexPage: NextPage<Props> = ({ assetId, ssr }) => {
property="og:title"
content={`Farcaster: ${token?.token?.name}`}
/>
<meta
property="og:image"
content={`${process.env.NEXT_PUBLIC_HOST_URL}/api/og/redirect?image=${base64EncodedImage}`}
/>

<meta
property="eth:nft:collection"
Expand All @@ -263,16 +259,6 @@ const IndexPage: NextPage<Props> = ({ assetId, ssr }) => {
property="eth:nft:schema"
content={token?.token?.kind?.toUpperCase()}
/>
<meta
property="eth:nft:media_url"
content={`${process.env.NEXT_PUBLIC_HOST_URL}/api/og/redirect?image=${base64EncodedImage}`}
/>

<meta property="fc:frame" content="vNext" />
<meta
property="fc:frame:image"
content={`${process.env.NEXT_PUBLIC_HOST_URL}/api/og/redirect?image=${base64EncodedImage}`}
/>
<meta property="fc:frame:button:1" content="Mint" />
<meta property="fc:frame:button:1:action" content="mint" />
<meta
Expand Down

0 comments on commit 60be6c3

Please sign in to comment.