1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-11-05 15:30:14 +01:00

Add page title

This commit is contained in:
Elias Schneider 2022-04-28 15:31:37 +02:00
parent 22bca7692e
commit 5845659bab
No known key found for this signature in database
GPG Key ID: D5EC1C72D93244FD
7 changed files with 36 additions and 6 deletions

11
src/components/Meta.tsx Normal file
View File

@ -0,0 +1,11 @@
import Head from "next/head";
const Meta = ({ title }: { title: string }) => {
return (
<Head>
<title>{title} - Pingvin Share</title>
</Head>
);
};
export default Meta;

View File

@ -1,6 +1,7 @@
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import React, { useContext } from "react"; import React, { useContext } from "react";
import AuthForm from "../../components/auth/AuthForm"; import AuthForm from "../../components/auth/AuthForm";
import Meta from "../../components/Meta";
import { IsSignedInContext } from "../../utils/auth.util"; import { IsSignedInContext } from "../../utils/auth.util";
const SignIn = () => { const SignIn = () => {
@ -9,7 +10,12 @@ const SignIn = () => {
if (isSignedIn) { if (isSignedIn) {
router.replace("/"); router.replace("/");
} else { } else {
return <AuthForm mode="signIn" />; return (
<>
<Meta title="Sign In" />
<AuthForm mode="signIn" />
</>
);
} }
}; };
export default SignIn; export default SignIn;

View File

@ -1,6 +1,7 @@
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import React, { useContext } from "react"; import React, { useContext } from "react";
import AuthForm from "../../components/auth/AuthForm"; import AuthForm from "../../components/auth/AuthForm";
import Meta from "../../components/Meta";
import { IsSignedInContext } from "../../utils/auth.util"; import { IsSignedInContext } from "../../utils/auth.util";
const SignUp = () => { const SignUp = () => {
@ -9,7 +10,12 @@ const SignUp = () => {
if (isSignedIn) { if (isSignedIn) {
router.replace("/"); router.replace("/");
} else { } else {
return <AuthForm mode="signUp" />; return (
<>
<Meta title="Sign Up" />
<AuthForm mode="signUp" />
</>
);
} }
}; };
export default SignUp; export default SignUp;

View File

@ -14,6 +14,7 @@ import React, { useContext } from "react";
import { Check } from "tabler-icons-react"; import { Check } from "tabler-icons-react";
import { IsSignedInContext } from "../utils/auth.util"; import { IsSignedInContext } from "../utils/auth.util";
import Image from "next/image"; import Image from "next/image";
import Meta from "../components/Meta";
const useStyles = createStyles((theme) => ({ const useStyles = createStyles((theme) => ({
inner: { inner: {
display: "flex", display: "flex",
@ -74,7 +75,8 @@ export default function Home() {
router.replace("/upload"); router.replace("/upload");
} else { } else {
return ( return (
<div> <>
<Meta title="Home" />
<Container> <Container>
<div className={classes.inner}> <div className={classes.inner}>
<div className={classes.content}> <div className={classes.content}>
@ -143,7 +145,7 @@ export default function Home() {
</Group> </Group>
</div> </div>
</Container> </Container>
</div> </>
); );
} }
} }

View File

@ -1,6 +1,7 @@
import { useModals } from "@mantine/modals"; import { useModals } from "@mantine/modals";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Meta from "../../components/Meta";
import FileList from "../../components/share/FileList"; import FileList from "../../components/share/FileList";
import showEnterPasswordModal from "../../components/share/showEnterPasswordModal"; import showEnterPasswordModal from "../../components/share/showEnterPasswordModal";
import showShareNotFoundModal from "../../components/share/showShareNotFoundModal"; import showShareNotFoundModal from "../../components/share/showShareNotFoundModal";
@ -41,13 +42,14 @@ const Share = () => {
}, []); }, []);
return ( return (
<div> <>
<Meta title={`Share ${shareId}`} />
<FileList <FileList
files={shareList} files={shareList}
shareId={shareId} shareId={shareId}
isLoading={shareList.length == 0} isLoading={shareList.length == 0}
/> />
</div> </>
); );
}; };

View File

@ -3,6 +3,7 @@ import { useModals } from "@mantine/modals";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { useContext, useState } from "react"; import { useContext, useState } from "react";
import { Link, Mail } from "tabler-icons-react"; import { Link, Mail } from "tabler-icons-react";
import Meta from "../components/Meta";
import Dropzone from "../components/upload/Dropzone"; import Dropzone from "../components/upload/Dropzone";
import FileList from "../components/upload/FileList"; import FileList from "../components/upload/FileList";
import showCompletedUploadModal from "../components/upload/showCompletedUploadModal"; import showCompletedUploadModal from "../components/upload/showCompletedUploadModal";
@ -70,6 +71,7 @@ const Upload = () => {
} else { } else {
return ( return (
<> <>
<Meta title="Upload" />
<Group position="right" mb={20}> <Group position="right" mb={20}>
<div> <div>
<Menu <Menu

View File

@ -1,3 +1,4 @@
// TODO: Add user account
const Account = () => { const Account = () => {
return <div></div>; return <div></div>;
}; };