mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-11-16 08:08:56 -05:00
Merge pull request #6 from neynarxyz/grin/fix-share-page
fix share page
This commit is contained in:
commit
9cd07170b9
@ -1,4 +1,4 @@
|
||||
import { Metadata } from "next";
|
||||
import type { Metadata } from "next";
|
||||
import { redirect } from "next/navigation";
|
||||
import { APP_URL, APP_NAME, APP_DESCRIPTION } from "~/lib/constants";
|
||||
import { getFrameEmbedMetadata } from "~/lib/utils";
|
||||
@ -7,8 +7,12 @@ export const revalidate = 300;
|
||||
// This is an example of how to generate a dynamically generated share page based on fid:
|
||||
// Sharing this route e.g. exmaple.com/share/123 will generate a share page for fid 123,
|
||||
// with the image dynamically generated by the opengraph-image API route.
|
||||
export async function generateMetadata({ params }: { params: { fid: string } }): Promise<Metadata> {
|
||||
const fid = params.fid;
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ fid: string }>;
|
||||
}): Promise<Metadata> {
|
||||
const { fid } = await params;
|
||||
const imageUrl = `${APP_URL}/api/opengraph-image?fid=${fid}`;
|
||||
|
||||
return {
|
||||
@ -27,4 +31,4 @@ export async function generateMetadata({ params }: { params: { fid: string } }):
|
||||
export default function SharePage() {
|
||||
// redirect to home page
|
||||
redirect("/");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user