Skip to content

Commit

Permalink
Merge branch 'armando/grwth-4132-add-frame-tags-to-collections-page' …
Browse files Browse the repository at this point in the history
…into dev
  • Loading branch information
r3lays committed Feb 23, 2024
2 parents b330bf2 + bab6d6d commit 7c2d47a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 17 deletions.
4 changes: 3 additions & 1 deletion components/primitives/CryptoCurrencyIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { styled } from '../../stitches.config'
import { StyledComponent } from '@stitches/react/types/styled-component'
import { zeroAddress } from 'viem'
import { useMarketplaceChain } from 'hooks'
import supportedChains, { DefaultChain } from 'utils/chains'

type Props = {
address: string
Expand All @@ -17,10 +18,11 @@ const CryptoCurrencyIcon: FC<Props> = ({
css,
}) => {
const { proxyApi } = useMarketplaceChain()
const chain = supportedChains.find((chain) => chain.id === chainId)

return (
<StyledImg
src={`${process.env.NEXT_PUBLIC_PROXY_URL}${proxyApi}/redirect/currency/${address}/icon/v1`}
src={`${process.env.NEXT_PUBLIC_PROXY_URL}${chain?.proxyApi ?? proxyApi}/redirect/currency/${address}/icon/v1`}
css={css}
/>
)
Expand Down
16 changes: 16 additions & 0 deletions pages/[chain]/asset/[assetId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,22 @@ const IndexPage: NextPage<Props> = ({ assetId, ssr }) => {
property="fc:frame:button:1:target"
content={`eip155:${token?.token?.chainId}:${token?.token?.contract}:${token?.token?.tokenId}`}
/>

{token?.market?.floorAsk?.price?.amount?.native && (
<>
<meta
property="fc:frame:button:2"
content={`Buy ${
token.market.floorAsk.price.amount.native
} ${token.market.floorAsk.price.currency?.symbol?.toUpperCase()}`}
/>
<meta property="fc:frame:button:2:action" content="link" />
<meta
property="fc:frame:button:2:target"
content={`${process.env.PUBLIC_NEXT_HOST_URL}${router.asPath}`}
/>
</>
)}
</>
}
/>
Expand Down
49 changes: 33 additions & 16 deletions pages/[chain]/collection/[contract].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,39 +362,56 @@ const CollectionPage: NextPage<Props> = ({ id, ssr }) => {
description={ssr?.collection?.collections?.[0]?.description as string}
metatags={
<>
<meta property="eth:nft:collection" content={collection.name} />
<meta
property="og:title"
content={`Farcaster: ${collection?.name}`}
property="eth:nft:contract_address"
content={collection.primaryContract}
/>

<meta
property="eth:nft:collection"
content={`Farcaster: ${collection?.name}`}
property="eth:nft:creator_address"
content={collection.primaryContract}
/>
<meta
property="eth:nft:contract_address"
content={collection?.primaryContract}
property="eth:nft:schema"
content={collection.contractKind?.toLowerCase()}
/>
<meta
property="eth:nft:creator_address"
content={collection?.creator}
property="eth:nft:mint_status"
content={collection.isMinting ? 'live' : 'closed'}
/>
<meta
property="eth:nft:schema"
content={collection?.contractKind?.toUpperCase()}
property="eth:nft:chain"
content={client?.currentChain()?.name}
/>
<meta property="nft:chain" content={client?.currentChain()?.name} />
<meta property="fc:frame" content="vNext" />
<meta
property="eth:nft:media_url"
content={collection.banner || collection.image}
property="fc:frame:image"
content={collection.image || collection.banner}
/>
<meta property="fc:frame:image:aspect_ratio" content="1:1" />
<meta property="fc:frame:button:1" content="Mint" />
<meta property="fc:frame:button:1:action" content="mint" />
<meta
property="fc:frame:button:1:target"
content={`eip155:${
collection?.chainId
}:${collection.primaryContract?.toLowerCase()}`}
content={`eip155:${collection.chainId}:${collection.primaryContract}`}
/>

{collection.floorAsk?.price?.amount?.native && (
<>
<meta
property="fc:frame:button:2"
content={`Collect ${
collection.floorAsk.price.amount.native
} ${collection.floorAsk.price.currency?.symbol?.toUpperCase()}`}
/>
<meta property="fc:frame:button:2:action" content="link" />
<meta
property="fc:frame:button:2:target"
content={`${process.env.PUBLIC_NEXT_HOST_URL}${router.asPath}`}
/>
</>
)}
</>
}
/>
Expand Down

0 comments on commit 7c2d47a

Please sign in to comment.