Skip to content

Commit

Permalink
fix: better titles with templates and SEO optimization
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <noreply@github.com>
  • Loading branch information
virtual-designer authored Aug 28, 2024
1 parent ea90d45 commit 05cdc1a
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 54 deletions.
20 changes: 14 additions & 6 deletions src/app/(main)/challenge/auth/discord/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,30 @@ import LoginWithDiscord from "@/components/Login/LoginWithDiscord";
import { Metadata } from "next";

export const metadata: Metadata = {
title: "Login with Discord - SudoBot",
title: "Login with Discord",
robots: {
index: false,
follow: false,
},
};

export default function Page({ searchParams }: { searchParams: Record<string, string> }) {
export default function Page({
searchParams,
}: {
searchParams: Record<string, string>;
}) {
const { code } = searchParams;

if (!code) {
return (
<div className="flex min-h-[80vh] flex-col items-center justify-center py-10 md:py-20">
<h1 className="pb-3 text-center text-3xl lg:text-4xl">Invalid request payload</h1>
<h1 className="pb-3 text-center text-3xl lg:text-4xl">
Invalid request payload
</h1>
<div className="relative mt-5 flex min-h-full w-full items-center justify-center">
<p>
It looks like you&rsquo;ve come across a page where you shouldn&rsquo;t be! The paylod in this
URL is invalid.
It looks like you&rsquo;ve come across a page where you
shouldn&rsquo;t be! The paylod in this URL is invalid.
</p>
</div>
</div>
Expand All @@ -28,7 +34,9 @@ export default function Page({ searchParams }: { searchParams: Record<string, st

return (
<div className="flex min-h-[80vh] flex-col items-center justify-center py-10 md:py-20">
<h1 className="pb-3 text-center text-3xl lg:text-4xl">Login with Discord</h1>
<h1 className="pb-3 text-center text-3xl lg:text-4xl">
Login with Discord
</h1>

<div className="relative mt-5 flex min-h-full w-full flex-col items-center justify-center text-center">
<LoginWithDiscord code={code} />
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/challenge/discord/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import DiscordVerification from "@/components/Verification/DiscordVerification";
import { Metadata } from "next";

export const metadata: Metadata = {
title: "Verify with Discord - SudoBot",
title: "Verify with Discord",
robots: {
index: false,
follow: false,
Expand Down
26 changes: 19 additions & 7 deletions src/app/(main)/challenge/email/complete/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,30 @@ import FinishEmailVerification from "@/components/Verification/FinishEmailVerifi
import { Metadata } from "next";

export const metadata: Metadata = {
title: "Complete Email Address Verification - SudoBot",
title: "Complete Email Address Verification",
robots: {
index: false,
follow: false,
},
};

export default function Page({ searchParams }: { searchParams: Record<string, string> }) {
export default function Page({
searchParams,
}: {
searchParams: Record<string, string>;
}) {
const { eml_token: emailToken, state: token, addr: email } = searchParams;

if (!emailToken || !token || !email) {
return (
<div className="flex min-h-[80vh] flex-col items-center justify-center py-10 md:py-20">
<h1 className="pb-3 text-center text-3xl lg:text-4xl">Invalid request payload</h1>
<h1 className="pb-3 text-center text-3xl lg:text-4xl">
Invalid request payload
</h1>
<div className="relative mt-5 flex min-h-full w-full items-center justify-center">
<p>
It looks like you&rsquo;ve come across a page where you shouldn&rsquo;t be! The paylod in this
URL is invalid.
It looks like you&rsquo;ve come across a page where you
shouldn&rsquo;t be! The paylod in this URL is invalid.
</p>
</div>
</div>
Expand All @@ -28,10 +34,16 @@ export default function Page({ searchParams }: { searchParams: Record<string, st

return (
<div className="flex min-h-[80vh] flex-col items-center justify-center py-10 md:py-20">
<h1 className="pb-3 text-center text-3xl lg:text-4xl">Verify with Email Address</h1>
<h1 className="pb-3 text-center text-3xl lg:text-4xl">
Verify with Email Address
</h1>

<div className="relative mt-5 flex min-h-full w-full flex-col items-center justify-center text-center">
<FinishEmailVerification token={token} emailToken={emailToken} email={email} />
<FinishEmailVerification
token={token}
emailToken={emailToken}
email={email}
/>
</div>
</div>
);
Expand Down
20 changes: 14 additions & 6 deletions src/app/(main)/challenge/email/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,30 @@ import EmailVerification from "@/components/Verification/EmailVerification";
import { Metadata } from "next";

export const metadata: Metadata = {
title: "Verify with Email Address - SudoBot",
title: "Verify with Email Address",
robots: {
index: false,
follow: false,
},
};

export default function Page({ searchParams }: { searchParams: Record<string, string> }) {
export default function Page({
searchParams,
}: {
searchParams: Record<string, string>;
}) {
const { state: token } = searchParams;

if (!token) {
return (
<div className="flex min-h-[80vh] flex-col items-center justify-center py-10 md:py-20">
<h1 className="pb-3 text-center text-3xl lg:text-4xl">Invalid request payload</h1>
<h1 className="pb-3 text-center text-3xl lg:text-4xl">
Invalid request payload
</h1>
<div className="relative mt-5 flex min-h-full w-full items-center justify-center">
<p>
It looks like you&rsquo;ve come across a page where you shouldn&rsquo;t be! The paylod in this
URL is invalid.
It looks like you&rsquo;ve come across a page where you
shouldn&rsquo;t be! The paylod in this URL is invalid.
</p>
</div>
</div>
Expand All @@ -28,7 +34,9 @@ export default function Page({ searchParams }: { searchParams: Record<string, st

return (
<div className="flex min-h-[80vh] flex-col items-center justify-center py-10 md:py-20">
<h1 className="pb-3 text-center text-3xl lg:text-4xl">Verify with Email Address</h1>
<h1 className="pb-3 text-center text-3xl lg:text-4xl">
Verify with Email Address
</h1>

<div className="relative mt-5 flex min-h-full w-full flex-col items-center justify-center text-center">
<EmailVerification token={token} />
Expand Down
20 changes: 14 additions & 6 deletions src/app/(main)/challenge/google/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,30 @@ import GoogleVerification from "@/components/Verification/GoogleVerification";
import { Metadata } from "next";

export const metadata: Metadata = {
title: "Verify with Google - SudoBot",
title: "Verify with Google",
robots: {
index: false,
follow: false,
},
};

export default function Page({ searchParams }: { searchParams: Record<string, string> }) {
export default function Page({
searchParams,
}: {
searchParams: Record<string, string>;
}) {
const { code, state: token } = searchParams;

if (!code || !token) {
return (
<div className="flex min-h-[80vh] flex-col items-center justify-center py-10 md:py-20">
<h1 className="pb-3 text-center text-3xl lg:text-4xl">Invalid request payload</h1>
<h1 className="pb-3 text-center text-3xl lg:text-4xl">
Invalid request payload
</h1>
<div className="relative mt-5 flex min-h-full w-full items-center justify-center">
<p>
It looks like you&rsquo;ve come across a page where you shouldn&rsquo;t be! The paylod in this
URL is invalid.
It looks like you&rsquo;ve come across a page where you
shouldn&rsquo;t be! The paylod in this URL is invalid.
</p>
</div>
</div>
Expand All @@ -28,7 +34,9 @@ export default function Page({ searchParams }: { searchParams: Record<string, st

return (
<div className="flex min-h-[80vh] flex-col items-center justify-center py-10 md:py-20">
<h1 className="pb-3 text-center text-3xl lg:text-4xl">Verify with Google</h1>
<h1 className="pb-3 text-center text-3xl lg:text-4xl">
Verify with Google
</h1>

<div className="relative mt-5 flex min-h-full w-full flex-col items-center justify-center text-center">
<GoogleVerification code={code} token={token} />
Expand Down
12 changes: 7 additions & 5 deletions src/app/(main)/donate/page.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import { Metadata } from "next";
import { DONATION_URL } from "@/config/links";
import Link from "@/components/Navigation/Link";
import RedirectTo from "@/components/Navigation/RedirectTo";
import { DONATION_URL } from "@/config/links";
import { Metadata } from "next";

export const metadata: Metadata = {
title: "Donate - SudoBot"
title: "Donate",
};

export default function NotFound() {
return (
<div className="flex min-h-[80svh] items-center justify-center">
<div className="flex min-h-[80svh] items-center justify-center">
<main className="mx-auto my-5 w-96 text-center lg:my-10">
<h1 className="text-3xl lg:text-4xl">
<span className="text-blue-500">Redirecting...</span>
</h1>
<RedirectTo to={DONATION_URL} />
<p className="mt-2 text-[#999]">You&rsquo;ll be redirected to the donation page shortly.</p>
<p className="mt-2 text-[#999]">
You&rsquo;ll be redirected to the donation page shortly.
</p>
<hr className="my-3 border-t-1 border-t-gray-200 dark:border-t-gray-700" />
<p className="text-[#999]">
If you&rsquo;re not being redirected in 5 seconds, you can{" "}
Expand Down
29 changes: 20 additions & 9 deletions src/app/(main)/guilds/[id]/verify/next/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ export const generateMetadata = async ({
searchParams: Record<string, string>;
params: Record<string, string>;
}): Promise<Metadata> => {
const { isValid, response } = await fetchVerificationInfo(params.id, searchParams.token);
const { isValid, response } = await fetchVerificationInfo(
params.id,
searchParams.token,
);

return {
title:
isValid && !response?.data.needs_captcha
? `Verify to continue to ${response!.data.guild.name} - SudoBot`
: `Invalid verification token - SudoBot`,
? `Verify to continue to ${response!.data.guild.name}`
: `Invalid verification token`,
robots: {
index: false,
follow: false,
Expand All @@ -56,7 +59,10 @@ export default async function Page({
searchParams: Record<string, string>;
params: Record<string, string>;
}) {
const { isValid, response } = await fetchVerificationInfo(params.id, searchParams.token);
const { isValid, response } = await fetchVerificationInfo(
params.id,
searchParams.token,
);

if (response?.data.needs_captcha) {
redirect(
Expand All @@ -67,12 +73,16 @@ export default async function Page({
return (
<div className="flex min-h-[80vh] flex-col items-center justify-center py-10 md:py-20">
<h1 className="pb-3 text-center text-3xl lg:text-4xl">
{isValid ? "Choose a verification method" : "Invalid request payload"}
{isValid
? "Choose a verification method"
: "Invalid request payload"}
</h1>
{isValid && (
<h3 className="pb-10 text-center text-[#999] md:pb-20 lg:text-lg">
to continue to{" "}
<strong className="font-semibold text-black dark:text-white">{response?.data?.guild?.name}</strong>
<strong className="font-semibold text-black dark:text-white">
{response?.data?.guild?.name}
</strong>
</h3>
)}

Expand All @@ -81,13 +91,14 @@ export default async function Page({
<VerificationMethods
token={searchParams.token}
allowedMethods={
response?.data?.supported_methods ?? (["discord", "google", "github", "email"] as const)
response?.data?.supported_methods ??
(["discord", "google", "github", "email"] as const)
}
/>
) : (
<p>
It looks like you&rsquo;ve come across a page where you shouldn&rsquo;t be! The payload in this
URL is invalid.
It looks like you&rsquo;ve come across a page where you
shouldn&rsquo;t be! The payload in this URL is invalid.
</p>
)}
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/app/(main)/logs/[guild]/deleted_messages/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ export const generateMetadata = async ({
}

return {
title: "Message Deletion Logs - SudoBot",
title: "Message Deletion Logs",
description: "See a detailed log of deleted messages in your server.",
robots: { index: false, follow: false },
};
};

const DeletedMessageLogPage: FC<{ params?: Record<string, string>; searchParams?: Record<string, string> }> = ({
params,
searchParams,
}) => {
const DeletedMessageLogPage: FC<{
params?: Record<string, string>;
searchParams?: Record<string, string>;
}> = ({ params, searchParams }) => {
const { guild: guildId } = params || {};
const { du: dataURL } = searchParams || {};

Expand Down
6 changes: 6 additions & 0 deletions src/app/(main)/support/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import SupportForm from "@/features/SupportForm/SupportForm";
import { ServerComponentProps } from "@/types/ServerComponentProps";
import { Spacer } from "@nextui-org/react";
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Support",
description: "Contact our support team for help.",
};

export default function Page({ searchParams }: ServerComponentProps) {
const form = searchParams?.form;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function generateMetadata({

if (!id || !userId || !requestToken) {
return {
title: "419 Page Expired - SudoBot",
title: "419 Page Expired",
};
}

Expand All @@ -37,12 +37,12 @@ export async function generateMetadata({

if (!guild || error) {
return {
title: "419 Page Expired - SudoBot",
title: "419 Page Expired",
};
}

return {
title: "Verify to Continue - SudoBot",
title: "Verify to Continue",
robots: {
index: false,
follow: false,
Expand Down
Loading

0 comments on commit 05cdc1a

Please sign in to comment.