Skip to content

Commit

Permalink
feat: migrate to new metadata component
Browse files Browse the repository at this point in the history
  • Loading branch information
flowergardn committed Dec 9, 2023
1 parent f45e505 commit 084c1de
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 47 deletions.
2 changes: 1 addition & 1 deletion src/components/Meta.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Head from "next/head";

let defaults = {
title: "bday.quest",
title: "bday.quest (beta)",
description: "Create virtual birthday cards",
color: "#eb5d71",
};
Expand Down
12 changes: 5 additions & 7 deletions src/pages/c/[id]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { GetStaticProps, NextPage } from "next";
import Head from "next/head";
import Navbar from "~/components/Navbar";
import { generateSSGHelper } from "~/server/api/helpers/ssgHelper";
import { api } from "~/utils/api";
import Signatures from "~/components/Signatures";
import Link from "next/link";
import Meta from "~/components/Meta";

const CardPage: NextPage<{ id: string }> = ({ id }) => {
const {
Expand Down Expand Up @@ -54,12 +54,10 @@ const CardPage: NextPage<{ id: string }> = ({ id }) => {

return (
<>
<Head>
<title>Sign this card | bday.quest (beta)</title>
<meta name="description" content={data.description} />
<link rel="icon" href="/favicon.ico" />
</Head>

<Meta
title="Sign this card | bday.quest (beta)"
description={data.description}
/>
<Navbar />
<div className="hero flex min-h-screen flex-col items-center bg-base-100">
<div className="card mb-12 mt-20 w-full max-w-sm shrink-0 p-6 shadow-2xl">
Expand Down
8 changes: 2 additions & 6 deletions src/pages/c/[id]/sign.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { GetStaticProps, NextPage } from "next";
import Head from "next/head";
import Navbar from "~/components/Navbar";
import { generateSSGHelper } from "~/server/api/helpers/ssgHelper";
import { api } from "~/utils/api";
import { useForm } from "react-hook-form";
import type { SubmitHandler } from "react-hook-form";
import { useUser } from "@clerk/nextjs";
import Meta from "~/components/Meta";

type FormValues = {
message: string;
Expand Down Expand Up @@ -111,11 +111,7 @@ const CardPage: NextPage<{ id: string }> = ({ id }) => {

return (
<>
<Head>
<title>bday.quest</title>
<meta name="description" content={data.description} />
<link rel="icon" href="/favicon.ico" />
</Head>
<Meta />

<Navbar />
<div className="hero flex min-h-screen flex-col items-center bg-base-100">
Expand Down
11 changes: 2 additions & 9 deletions src/pages/create.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Head from "next/head";
import { useForm } from "react-hook-form";
import { api } from "~/utils/api";
import dayjs from "dayjs";
import Navbar from "~/components/Navbar";
import { Textbox } from "~/components/EditCard";
import Meta from "~/components/Meta";

export default function CreateCard() {
type CardDataValues = {
Expand All @@ -21,14 +21,7 @@ export default function CreateCard() {

return (
<>
<Head>
<title>bday.quest | Create</title>
<meta
name="description"
content="Create custom birthday cards for your friends."
/>
<link rel="icon" href="/favicon.ico" />
</Head>
<Meta title="Create a card | bday.quest (beta)" />

<Navbar />
<div className="hero min-h-screen bg-base-200">
Expand Down
11 changes: 2 additions & 9 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SignInButton, useAuth } from "@clerk/nextjs";
import Head from "next/head";
import Link from "next/link";
import Meta from "~/components/Meta";
import Navbar from "~/components/Navbar";

export default function Home() {
Expand Down Expand Up @@ -30,14 +30,7 @@ export default function Home() {

return (
<>
<Head>
<title>bday.quest</title>
<meta
name="description"
content="Create custom birthday cards for your friends."
/>
<link rel="icon" href="/favicon.ico" />
</Head>
<Meta title="bday.quest (beta)" />

<Navbar />
<div className="hero min-h-screen bg-base-200">
Expand Down
8 changes: 2 additions & 6 deletions src/pages/manage/[id].tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { GetStaticProps, NextPage } from "next";
import Head from "next/head";
import type { SubmitHandler } from "react-hook-form";
import { useForm } from "react-hook-form";
import toast from "react-hot-toast";
import { Textbox } from "~/components/EditCard";
import type { CardDataValues } from "~/components/EditCard";
import Meta from "~/components/Meta";
import Navbar from "~/components/Navbar";
import Signatures from "~/components/Signatures";
import { generateSSGHelper } from "~/server/api/helpers/ssgHelper";
Expand Down Expand Up @@ -72,11 +72,7 @@ const ManageCard: NextPage<{ id: string }> = ({ id }) => {

return (
<>
<Head>
<title>bday.quest</title>
<meta name="description" content={data.description} />
<link rel="icon" href="/favicon.ico" />
</Head>
<Meta />

<Navbar />
<div className="hero flex min-h-screen items-center justify-center bg-base-200">
Expand Down
11 changes: 2 additions & 9 deletions src/pages/manage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Cards } from "@prisma/client";
import Head from "next/head";
import { Cake, Calendar, Eye, Pen, Trash } from "~/components/Icons";
import Navbar from "~/components/Navbar";
import Link from "next/link";
Expand All @@ -8,6 +7,7 @@ import toast from "react-hot-toast";

import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";
import Meta from "~/components/Meta";
dayjs.extend(relativeTime);

export default function ManageCards() {
Expand Down Expand Up @@ -116,14 +116,7 @@ export default function ManageCards() {

return (
<>
<Head>
<title>bday.quest | Manage</title>
<meta
name="description"
content="Create custom birthday cards for your friends."
/>
<link rel="icon" href="/favicon.ico" />
</Head>
<Meta title="Manage | bday.quest (beta)" />

<Navbar />
<div className="hero flex min-h-screen flex-col items-center bg-base-100">
Expand Down

0 comments on commit 084c1de

Please sign in to comment.