-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: light house, repetitive address, share to various socials
- Loading branch information
1 parent
8a793f1
commit ce84e9b
Showing
5 changed files
with
1,156 additions
and
666 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
export async function generateMetadata({ params }) { | ||
const baseUri = process.env.NEXT_PUBLIC_URI || "https://app.myriadflow.com"; | ||
|
||
// Fetch phygitals | ||
const nftsRes = await fetch( | ||
`${baseUri}/phygitals/all/554b4903-9a06-4031-98f4-48276c427f78` | ||
); | ||
const phygitals = await nftsRes.json(); | ||
|
||
// Format the NFT name from params | ||
const nftName = params?.id | ||
.replace(/-/g, " ") | ||
.replace(/\b\w/g, (char) => char.toUpperCase()); | ||
|
||
// Find the matching NFT | ||
const nft = phygitals.find((p) => p.name === nftName); | ||
|
||
if (!nft) { | ||
return { | ||
title: "NFT Not Found", | ||
}; | ||
} | ||
|
||
// Get detailed NFT info | ||
const nftDetailRes = await fetch(`${baseUri}/phygitals/${nft.id}`); | ||
const nftDetail = await nftDetailRes.json(); | ||
|
||
const imageUrl = `https://nftstorage.link/ipfs/${nftDetail.image?.slice(7)}`; | ||
const title = `${nftDetail.name} | MyriadFlow Discover`; | ||
const description = | ||
nftDetail.description || | ||
"Own the future of collecting! MyriadFlow Discover lets you buy, sell, and showcase unique phygital NFTs. Explore immersive VR experiences that bring your digital collectibles to life."; | ||
|
||
return { | ||
title, | ||
description, | ||
openGraph: { | ||
title, | ||
description, | ||
images: [ | ||
{ | ||
url: imageUrl, | ||
width: 1200, | ||
height: 630, | ||
alt: nftDetail.name, | ||
}, | ||
], | ||
type: "website", | ||
url: `https://discover.myriadflow.com/nfts/${params.id}`, | ||
}, | ||
twitter: { | ||
card: "summary_large_image", | ||
site: "@MyriadFlow", | ||
title, | ||
description, | ||
images: [imageUrl], | ||
}, | ||
other: { | ||
"og:site_name": "MyriadFlow Discover", | ||
"og:type": "website", | ||
"twitter:domain": "discover.myriadflow.com", | ||
"twitter:url": `https://discover.myriadflow.com/nfts/${params.id}`, | ||
}, | ||
}; | ||
} | ||
|
||
export default function NFTLayout({ children }) { | ||
return children; | ||
} |
Oops, something went wrong.