Skip to content

Commit 1440e24

Browse files
committed
Metadata for FAQ / Stats / User profile
1 parent e9830a4 commit 1440e24

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

packages/nextjs/app/faqs/page.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Link from "next/link";
2+
import { getMetadata } from "~~/utils/scaffold-eth/getMetadata";
23

34
// ToDo:
45
// - Review the existing FAQs
@@ -51,6 +52,11 @@ const faqs = [
5152
},
5253
];
5354

55+
export const metadata = getMetadata({
56+
title: "FAQ",
57+
description: "Check out the FAQ for the BuidlGuidl CTF",
58+
});
59+
5460
export default function FaqsPage() {
5561
return (
5662
<div className="mx-auto max-w-7xl px-6 py-16 sm:py-24 lg:px-8">

packages/nextjs/app/profile/[address]/page.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
import Image from "next/image";
22
import { UserData } from "~~/components/UserData";
33
import { getChallenges } from "~~/utils/getChallenges";
4+
import { getMetadata } from "~~/utils/scaffold-eth/getMetadata";
45

56
interface ProfilePageProps {
67
params: {
78
address: string;
89
};
910
}
1011

12+
export async function generateMetadata({ params }: ProfilePageProps) {
13+
const { address } = params;
14+
const displayAddress = address?.slice(0, 4) + "..." + address?.slice(-4);
15+
return getMetadata({
16+
title: `${displayAddress} Profile`,
17+
description: `Check out ${address} progress in the BuidlGuidl CTF`,
18+
});
19+
}
20+
1121
export default async function ProfilePage({ params }: ProfilePageProps) {
1222
const { address } = params;
1323
const challenges = await getChallenges();

packages/nextjs/app/stats/page.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22

33
import { useQuery } from "@tanstack/react-query";
44
import type { NextPage } from "next";
5+
import { getMetadata } from "~~/utils/scaffold-eth/getMetadata";
56

67
const thStyles = "whitespace-nowrap px-3 py-3.5";
78
const tdStyles = "whitespace-nowrap px-3 py-4";
89

10+
export const metadata = getMetadata({
11+
title: "Stats",
12+
description: "Check out the stats for the BuidlGuidl CTF",
13+
});
14+
915
const Stats: NextPage = () => {
1016
const {
1117
isPending,

0 commit comments

Comments
 (0)