From 5845659bab511a046673f57d10aa89a3c5a53a13 Mon Sep 17 00:00:00 2001 From: Elias Schneider Date: Thu, 28 Apr 2022 15:31:37 +0200 Subject: [PATCH] Add page title --- src/components/Meta.tsx | 11 +++++++++++ src/pages/auth/signIn.tsx | 8 +++++++- src/pages/auth/signUp.tsx | 8 +++++++- src/pages/index.tsx | 6 ++++-- src/pages/share/[shareId].tsx | 6 ++++-- src/pages/upload.tsx | 2 ++ src/pages/user/account.tsx | 1 + 7 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 src/components/Meta.tsx diff --git a/src/components/Meta.tsx b/src/components/Meta.tsx new file mode 100644 index 0000000..4de68b3 --- /dev/null +++ b/src/components/Meta.tsx @@ -0,0 +1,11 @@ +import Head from "next/head"; + +const Meta = ({ title }: { title: string }) => { + return ( + + {title} - Pingvin Share + + ); +}; + +export default Meta; diff --git a/src/pages/auth/signIn.tsx b/src/pages/auth/signIn.tsx index 36abfc5..a710ebe 100644 --- a/src/pages/auth/signIn.tsx +++ b/src/pages/auth/signIn.tsx @@ -1,6 +1,7 @@ import { useRouter } from "next/router"; import React, { useContext } from "react"; import AuthForm from "../../components/auth/AuthForm"; +import Meta from "../../components/Meta"; import { IsSignedInContext } from "../../utils/auth.util"; const SignIn = () => { @@ -9,7 +10,12 @@ const SignIn = () => { if (isSignedIn) { router.replace("/"); } else { - return ; + return ( + <> + + + + ); } }; export default SignIn; diff --git a/src/pages/auth/signUp.tsx b/src/pages/auth/signUp.tsx index 89b083b..a005fa8 100644 --- a/src/pages/auth/signUp.tsx +++ b/src/pages/auth/signUp.tsx @@ -1,6 +1,7 @@ import { useRouter } from "next/router"; import React, { useContext } from "react"; import AuthForm from "../../components/auth/AuthForm"; +import Meta from "../../components/Meta"; import { IsSignedInContext } from "../../utils/auth.util"; const SignUp = () => { @@ -9,7 +10,12 @@ const SignUp = () => { if (isSignedIn) { router.replace("/"); } else { - return ; + return ( + <> + + + + ); } }; export default SignUp; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index caec0dc..dadc77c 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -14,6 +14,7 @@ import React, { useContext } from "react"; import { Check } from "tabler-icons-react"; import { IsSignedInContext } from "../utils/auth.util"; import Image from "next/image"; +import Meta from "../components/Meta"; const useStyles = createStyles((theme) => ({ inner: { display: "flex", @@ -74,7 +75,8 @@ export default function Home() { router.replace("/upload"); } else { return ( -
+ <> +
@@ -143,7 +145,7 @@ export default function Home() {
-
+ ); } } diff --git a/src/pages/share/[shareId].tsx b/src/pages/share/[shareId].tsx index b81763a..3122925 100644 --- a/src/pages/share/[shareId].tsx +++ b/src/pages/share/[shareId].tsx @@ -1,6 +1,7 @@ import { useModals } from "@mantine/modals"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; +import Meta from "../../components/Meta"; import FileList from "../../components/share/FileList"; import showEnterPasswordModal from "../../components/share/showEnterPasswordModal"; import showShareNotFoundModal from "../../components/share/showShareNotFoundModal"; @@ -41,13 +42,14 @@ const Share = () => { }, []); return ( -
+ <> + -
+ ); }; diff --git a/src/pages/upload.tsx b/src/pages/upload.tsx index 8d736a8..8d00652 100644 --- a/src/pages/upload.tsx +++ b/src/pages/upload.tsx @@ -3,6 +3,7 @@ import { useModals } from "@mantine/modals"; import { useRouter } from "next/router"; import { useContext, useState } from "react"; import { Link, Mail } from "tabler-icons-react"; +import Meta from "../components/Meta"; import Dropzone from "../components/upload/Dropzone"; import FileList from "../components/upload/FileList"; import showCompletedUploadModal from "../components/upload/showCompletedUploadModal"; @@ -70,6 +71,7 @@ const Upload = () => { } else { return ( <> +
{ return
; };