From 7b88065fb52086806ec03b5c197ee615cee38645 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Tue, 20 Feb 2024 02:57:42 +1030 Subject: [PATCH] feat: add titles for all pages --- src/app/(account)/forgot-password/page.tsx | 5 +++++ src/app/(account)/join/page.tsx | 7 ++++++- src/app/(account)/settings/page.tsx | 5 +++++ src/app/(account)/signin/page.tsx | 5 +++++ src/app/about/page.tsx | 7 ++++++- src/app/admin/page.tsx | 5 +++++ src/app/contact/page.tsx | 5 +++++ src/app/events/page.tsx | 5 +++++ src/app/layout.tsx | 5 ++++- src/app/sponsors/page.tsx | 5 +++++ 10 files changed, 51 insertions(+), 3 deletions(-) diff --git a/src/app/(account)/forgot-password/page.tsx b/src/app/(account)/forgot-password/page.tsx index 48f7ee82..213aaaca 100644 --- a/src/app/(account)/forgot-password/page.tsx +++ b/src/app/(account)/forgot-password/page.tsx @@ -5,12 +5,17 @@ import ControlledField from '@/components/ControlledField'; import FancyRectangle from '@/components/FancyRectangle'; import { useSignIn } from '@clerk/nextjs'; import { zodResolver } from '@hookform/resolvers/zod'; +import type { Metadata } from 'next'; import { useState } from 'react'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; import { handleClerkErrors } from '../helpers'; import { codeSchema, emailSchema, passwordSchema } from '../schemas'; +export const metadata: Metadata = { + title: 'Forgot Password', +}; + const sendCodeSchema = z.object({ email: emailSchema, }); diff --git a/src/app/(account)/join/page.tsx b/src/app/(account)/join/page.tsx index e3a81d6a..7bb7f7d4 100644 --- a/src/app/(account)/join/page.tsx +++ b/src/app/(account)/join/page.tsx @@ -3,6 +3,7 @@ import FancyRectangle from '@/components/FancyRectangle'; import Title from '@/components/Title'; import { SignedIn, SignedOut, useUser } from '@clerk/nextjs'; +import type { Metadata } from 'next'; import Link from 'next/link'; import { useEffect } from 'react'; import ProgressBar from './ProgressBar'; @@ -12,7 +13,11 @@ import StepThree from './steps/StepThree'; import StepTwo from './steps/StepTwo'; import { useJoinUsHeading, useJoinUsStep } from './store'; -export default function JoinUsPage() { +export const metadata: Metadata = { + title: 'Join', +}; + +export default function JoinPage() { const { step, setStep } = useJoinUsStep(); const { heading } = useJoinUsHeading(); diff --git a/src/app/(account)/settings/page.tsx b/src/app/(account)/settings/page.tsx index f6e92e0c..a360c770 100644 --- a/src/app/(account)/settings/page.tsx +++ b/src/app/(account)/settings/page.tsx @@ -3,10 +3,15 @@ import Title from '@/components/Title'; import { checkUserExists } from '@/server/check-user-exists'; import { verifyMembershipPayment } from '@/server/verify-membership-payment'; import { currentUser } from '@clerk/nextjs'; +import type { Metadata } from 'next'; import Link from 'next/link'; import { notFound } from 'next/navigation'; import Settings from './Settings'; +export const metadata: Metadata = { + title: 'Settings', +}; + export default async function SettingsPage() { const user = await currentUser(); if (!user) return notFound(); diff --git a/src/app/(account)/signin/page.tsx b/src/app/(account)/signin/page.tsx index 18acf891..264269f1 100644 --- a/src/app/(account)/signin/page.tsx +++ b/src/app/(account)/signin/page.tsx @@ -5,6 +5,7 @@ import ControlledField from '@/components/ControlledField'; import FancyRectangle from '@/components/FancyRectangle'; import { useSignIn } from '@clerk/clerk-react'; import { zodResolver } from '@hookform/resolvers/zod'; +import type { Metadata } from 'next'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useState } from 'react'; @@ -14,6 +15,10 @@ import { z } from 'zod'; import { handleClerkErrors } from '../helpers'; import { emailSchema } from '../schemas'; +export const metadata: Metadata = { + title: 'Sign In', +}; + const signInSchema = z.object({ email: emailSchema, password: z.string().min(1, { message: 'Please enter your password' }), diff --git a/src/app/about/page.tsx b/src/app/about/page.tsx index 39809bd4..e4a3532e 100644 --- a/src/app/about/page.tsx +++ b/src/app/about/page.tsx @@ -4,10 +4,15 @@ import Paragraph from '@/components/Paragraph'; import Title from '@/components/Title'; import { COMMITTEE_MEMBERS } from '@/data/committee-members'; import { LINKS } from '@/data/links'; +import type { Metadata } from 'next'; import Image from 'next/image'; import FAQ from './FAQ'; -export default function AboutUs() { +export const metadata: Metadata = { + title: 'About', +}; + +export default function AboutPage() { return (
diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index 234e69b3..618a2c53 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -2,9 +2,14 @@ import FancyRectangle from '@/components/FancyRectangle'; import Title from '@/components/Title'; import { db } from '@/db'; import { currentUser } from '@clerk/nextjs'; +import type { Metadata } from 'next'; import { notFound } from 'next/navigation'; import MemberForm from './MemberForm'; +export const metadata: Metadata = { + title: 'Admin Panel', +}; + const queryMembers = async () => { const dbMembers = await db.query.memberTable.findMany({ columns: { diff --git a/src/app/contact/page.tsx b/src/app/contact/page.tsx index 01c4bdbc..ad4be49b 100644 --- a/src/app/contact/page.tsx +++ b/src/app/contact/page.tsx @@ -1,8 +1,13 @@ import Title from '@/components/Title'; +import type { Metadata } from 'next'; import Contact from './Contact'; import Form from './Form'; import Sponsorship from './Sponsorship'; +export const metadata: Metadata = { + title: 'Contact', +}; + export default function ContactPage() { return (
diff --git a/src/app/events/page.tsx b/src/app/events/page.tsx index 6e5d255a..2795476d 100644 --- a/src/app/events/page.tsx +++ b/src/app/events/page.tsx @@ -1,8 +1,13 @@ +import type { Metadata } from 'next'; import Image from 'next/image'; import Events from './Events'; import FridayNight from './FridayNight'; import Info from './Info'; +export const metadata: Metadata = { + title: 'Events', +}; + export default function EventsPage() { return (
diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 967ea949..c99d36dc 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -7,7 +7,10 @@ import { Archivo } from 'next/font/google'; export const metadata: Metadata = { icons: '/favicon.ico', - title: 'Computer Science Club', + title: { + template: '%s | Computer Science Club', + default: 'Computer Science Club', + }, description: 'The University of Adelaide Computer Science Club is a student-run club for those with an interest in computer science or computing in general.', }; diff --git a/src/app/sponsors/page.tsx b/src/app/sponsors/page.tsx index f13e25da..233ec244 100644 --- a/src/app/sponsors/page.tsx +++ b/src/app/sponsors/page.tsx @@ -3,6 +3,11 @@ import Duck from '@/components/Duck'; import Paragraph from '@/components/Paragraph'; import Title from '@/components/Title'; import { YEAR } from '@/data/sponsors'; +import type { Metadata } from 'next'; + +export const metadata: Metadata = { + title: 'Sponsors', +}; export default function SponsorsPage() { return (