Skip to content

Commit a898b79

Browse files
authored
Merge pull request #10 from BuidlMasons/redirect-root-path
send user to speedrun when image clicked
2 parents 5021edb + 306e15c commit a898b79

File tree

2 files changed

+37
-29
lines changed

2 files changed

+37
-29
lines changed

packages/nextjs/app/layout.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,34 @@
1+
import { getFrameMetadata } from "@coinbase/onchainkit";
2+
import type { Metadata } from "next";
3+
14
export const viewport = {
25
width: "device-width",
36
initialScale: 1.0,
47
};
58

9+
const frameMetadata = getFrameMetadata({
10+
buttons: [
11+
{
12+
label: "⚡ Start",
13+
},
14+
],
15+
image: `https://speedrunethereum.com/thumbnail.png`,
16+
post_url: `${process.env.NEXT_PUBLIC_BASE_URL}/api/frame?id=0`,
17+
});
18+
19+
export const metadata: Metadata = {
20+
title: "Speed Run Ethereum",
21+
description: "Learn how to build on Ethereum; the superpowers and the gotchas.",
22+
openGraph: {
23+
title: "Speed Run Ethereum",
24+
description: "Learn how to build on Ethereum; the superpowers and the gotchas.",
25+
images: [`https://speedrunethereum.com/thumbnail.png`],
26+
},
27+
other: {
28+
...frameMetadata,
29+
},
30+
};
31+
632
export default function RootLayout({ children }: { children: React.ReactNode }) {
733
return (
834
<html lang="en">

packages/nextjs/app/page.tsx

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,15 @@
1-
import { getFrameMetadata } from "@coinbase/onchainkit";
2-
import type { Metadata } from "next";
1+
"use client";
32

4-
const frameMetadata = getFrameMetadata({
5-
buttons: [
6-
{
7-
label: "⚡ Start",
8-
},
9-
],
10-
image: `https://speedrunethereum.com/thumbnail.png`,
11-
post_url: `${process.env.NEXT_PUBLIC_BASE_URL}/api/frame?id=0`,
12-
});
13-
14-
export const metadata: Metadata = {
15-
title: "Speed Run Ethereum",
16-
description: "Learn how to build on Ethereum; the superpowers and the gotchas.",
17-
openGraph: {
18-
title: "Speed Run Ethereum",
19-
description: "Learn how to build on Ethereum; the superpowers and the gotchas.",
20-
images: [`https://speedrunethereum.com/thumbnail.png`],
21-
},
22-
other: {
23-
...frameMetadata,
24-
},
25-
};
3+
import { useEffect } from "react";
4+
import { useRouter } from "next/navigation";
265

276
export default function Page() {
28-
return (
29-
<>
30-
<h1>Speed Run Ethereum</h1>
31-
</>
32-
);
7+
const router = useRouter();
8+
9+
useEffect(() => {
10+
// Redirect users to the desired URL
11+
router.push("https://speedrunethereum.com/");
12+
}, [router]);
13+
14+
return null;
3315
}

0 commit comments

Comments
 (0)