1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-11-04 23:10:13 +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 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 <AuthForm mode="signIn" />;
return (
<>
<Meta title="Sign In" />
<AuthForm mode="signIn" />
</>
);
}
};
export default SignIn;

View File

@ -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 <AuthForm mode="signUp" />;
return (
<>
<Meta title="Sign Up" />
<AuthForm mode="signUp" />
</>
);
}
};
export default SignUp;

View File

@ -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 (
<div>
<>
<Meta title="Home" />
<Container>
<div className={classes.inner}>
<div className={classes.content}>
@ -143,7 +145,7 @@ export default function Home() {
</Group>
</div>
</Container>
</div>
</>
);
}
}

View File

@ -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 (
<div>
<>
<Meta title={`Share ${shareId}`} />
<FileList
files={shareList}
shareId={shareId}
isLoading={shareList.length == 0}
/>
</div>
</>
);
};

View File

@ -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 (
<>
<Meta title="Upload" />
<Group position="right" mb={20}>
<div>
<Menu

View File

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