Skip to content

Commit

Permalink
slight cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnafnafee committed Feb 28, 2022
1 parent f8b8418 commit 298b26f
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 65 deletions.
35 changes: 2 additions & 33 deletions components/SignIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,16 @@ export default function SignIn() {

return (
<ThemeProvider theme={theme}>
<Container component="main" maxWidth="xs">
<Container component="main">
<CssBaseline />
<Box
sx={{
marginTop: 8,
display: "flex",
flexDirection: "column",
alignItems: "center",
}}
>
<Avatar sx={{ m: 1, bgcolor: "secondary.main" }}>
<LockOutlinedIcon />
</Avatar>
<Typography component="h1" variant="h5">
Sign in
</Typography>
<Box
component="form"
onSubmit={handleSubmit}
noValidate
sx={{ mt: 1 }}
>
<Box component="form" onSubmit={handleSubmit} noValidate>
<TextField
margin="normal"
required
Expand All @@ -88,12 +76,6 @@ export default function SignIn() {
id="password"
autoComplete="current-password"
/>
<FormControlLabel
control={
<Checkbox value="remember" color="primary" />
}
label="Remember me"
/>
<Button
type="submit"
fullWidth
Expand All @@ -102,21 +84,8 @@ export default function SignIn() {
>
Sign In
</Button>
<Grid container>
<Grid item xs>
<Link href="#" variant="body2">
Forgot password?
</Link>
</Grid>
<Grid item>
<Link href="#" variant="body2">
{"Don't have an account? Sign Up"}
</Link>
</Grid>
</Grid>
</Box>
</Box>
<Copyright sx={{ mt: 8, mb: 4 }} />
</Container>
</ThemeProvider>
);
Expand Down
32 changes: 3 additions & 29 deletions components/SignUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export default function SignUp() {
const data = new FormData(event.currentTarget);
// eslint-disable-next-line no-console
console.log({
name: data.get("name"),
username: data.get("username"),
email: data.get("email"),
password: data.get("password"),
});
Expand All @@ -50,18 +52,11 @@ export default function SignUp() {
<CssBaseline />
<Box
sx={{
marginTop: 8,
display: "flex",
flexDirection: "column",
alignItems: "center",
}}
>
<Avatar sx={{ m: 1, bgcolor: "secondary.main" }}>
<LockOutlinedIcon />
</Avatar>
<Typography component="h1" variant="h5">
Sign Up
</Typography>
<Box
component="form"
onSubmit={handleSubmit}
Expand All @@ -87,7 +82,6 @@ export default function SignUp() {
label="Username"
name="username"
autoComplete="username"
autoFocus
variant="outlined"
/>
<TextField
Expand All @@ -98,7 +92,6 @@ export default function SignUp() {
label="Email Address"
name="email"
autoComplete="email"
autoFocus
variant="outlined"
/>
<TextField
Expand All @@ -112,35 +105,16 @@ export default function SignUp() {
autoComplete="current-password"
variant="outlined"
/>
<FormControlLabel
control={
<Checkbox value="remember" color="primary" />
}
label="Remember me"
/>
<Button
type="submit"
fullWidth
variant="contained"
sx={{ mt: 3, mb: 2 }}
>
Sign In
Sign Up
</Button>
<Grid container>
<Grid item xs>
<Link href="#" variant="body2">
Forgot password?
</Link>
</Grid>
<Grid item>
<Link href="#" variant="body2">
{"Don't have an account? Sign Up"}
</Link>
</Grid>
</Grid>
</Box>
</Box>
<Copyright sx={{ mt: 8, mb: 4 }} />
</Container>
</ThemeProvider>
);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@mui/lab": "^5.0.0-alpha.71",
"@mui/material": "^5.4.4",
"formik": "^2.2.9",
"formik-mui": "^4.0.0-alpha.3",
"next": "latest",
"react": "17.0.2",
"react-dom": "17.0.2",
Expand Down
5 changes: 5 additions & 0 deletions pages/_app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import "../styles/global.css";

export default function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />;
}
13 changes: 11 additions & 2 deletions pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ class MyDocument extends Document {

render() {
return (
<Html>
<Html lang="en">
<Head>
<link
href="https://fonts.googleapis.com/css2?family=Poppins&display=swap"
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossOrigin="true"
/>
<link
href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500;1,700&display=swap"
rel="stylesheet"
/>
</Head>
Expand Down
23 changes: 23 additions & 0 deletions pages/auth.js → pages/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
CustomTabPanel,
CustomTabsList,
} from "../components/CustomTab";
import Image from "next/image";

function AuthPage(props) {
const [value, setValue] = React.useState("1");
Expand All @@ -27,6 +28,27 @@ function AuthPage(props) {

return (
<Container>
<Head>
<title>Authenticate - Bookworm</title>
</Head>
<div
style={{
flexDirection: "column",
justifyContent: "center",
alignContent: "center",
marginTop: 80,
marginBottom: 50,
}}
>
<Image
alt="Mountains"
src="/images/bookworm-logo.png"
layout="responsive"
width={"200"}
height={"30vh"}
objectFit="contain"
/>
</div>
<TabsUnstyled defaultValue={0}>
<CustomTabsList>
<CustomTab>Sign In</CustomTab>
Expand All @@ -50,4 +72,5 @@ export async function getServerSideProps(context) {
props: { stars: json.stargazers_count },
};
}

export default AuthPage;
2 changes: 1 addition & 1 deletion pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function Home() {
<title>Welcome to Next.js!</title>
</Head>
<div>Welcome to Next.js!</div>
<Link href="/auth">
<Link href="/authenticate">
<a>Users</a>
</Link>
<br />
Expand Down
11 changes: 11 additions & 0 deletions styles/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* body {
font-family: "Poppins", Arial, Helvetica, sans-serif;
} */

body {
font-family: Poppins;
margin: 0;
padding: 0;
/* background: black; */
color: white;
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,11 @@ flatted@^3.1.0:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3"
integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==

formik-mui@^4.0.0-alpha.3:
version "4.0.0-alpha.3"
resolved "https://registry.yarnpkg.com/formik-mui/-/formik-mui-4.0.0-alpha.3.tgz#faca4b439c0653a8a33be97772da50709f0aa8c8"
integrity sha512-a696XpNIYulBd3LcwPt1+3BqtArdA/1hZryxMXT9azwucNwMcnnpVMR10yn6Qycd7eT//qv8V+r1XTBn0X8S1w==

formik@^2.2.9:
version "2.2.9"
resolved "https://registry.yarnpkg.com/formik/-/formik-2.2.9.tgz#8594ba9c5e2e5cf1f42c5704128e119fc46232d0"
Expand Down

0 comments on commit 298b26f

Please sign in to comment.