first
This commit is contained in:
@@ -1,7 +1,63 @@
|
||||
import '../styles/globals.css'
|
||||
import Head from "next/head";
|
||||
import Link from "next/link";
|
||||
import { useState } from "react";
|
||||
import {
|
||||
Button,
|
||||
Stack,
|
||||
Box,
|
||||
CssBaseline,
|
||||
AppBar,
|
||||
Toolbar,
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
import "../styles/globals.css";
|
||||
|
||||
function MyApp({ Component, pageProps }) {
|
||||
return <Component {...pageProps} />
|
||||
const [username, setUsername] = useState("");
|
||||
pageProps = { ...pageProps, username, setUsername };
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>ITSC Tool</title>
|
||||
<meta
|
||||
name="viewport"
|
||||
content="minimum-scale=1, initial-scale=1, width=device-width"
|
||||
/>
|
||||
<CssBaseline />
|
||||
</Head>
|
||||
<AppBar
|
||||
position="static"
|
||||
sx={{
|
||||
mb: 3,
|
||||
}}
|
||||
>
|
||||
<Toolbar
|
||||
sx={{
|
||||
flex: 1,
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Typography variant="h5">
|
||||
<Link href="/">ITSC Tool</Link>
|
||||
</Typography>
|
||||
{username && (
|
||||
<Button
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
onClick={() => {
|
||||
//localStorage.removeItem("username");
|
||||
setUsername("");
|
||||
}}
|
||||
>
|
||||
{username} (Logout)
|
||||
</Button>
|
||||
)}
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
<Component {...pageProps} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default MyApp
|
||||
export default MyApp;
|
||||
|
||||
Reference in New Issue
Block a user