Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
AykutSarac committed Oct 3, 2023
1 parent 0091a25 commit 482de39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
9 changes: 3 additions & 6 deletions src/pages/forgot-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import Head from "next/head";
import Link from "next/link";
import { Button, Group, Paper, Stack, TextInput, Text, Anchor } from "@mantine/core";
import { toast } from "react-hot-toast";
import { Footer } from "src/layout/Footer";
import { Navbar } from "src/layout/Navbar";
import Layout from "src/layout/Layout";
import { supabase } from "src/lib/api/supabase";

const ForgotPassword = () => {
Expand All @@ -25,12 +24,11 @@ const ForgotPassword = () => {
};

return (
<div>
<Layout>
<Head>
<title>Reset Password - JSON Crack</title>
<meta name="robots" content="noindex,nofollow" />
</Head>
<Navbar />
<Paper mx="auto" mt={70} maw={400} p="lg" withBorder>
<Text size="lg" weight={500}>
Reset Password
Expand Down Expand Up @@ -65,8 +63,7 @@ const ForgotPassword = () => {
)}
</Paper>
</Paper>
<Footer />
</div>
</Layout>
);
};

Expand Down
12 changes: 5 additions & 7 deletions src/pages/sign-in.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import {
import { useSession } from "@supabase/auth-helpers-react";
import { toast } from "react-hot-toast";
import { AiOutlineGithub, AiOutlineGoogle } from "react-icons/ai";
import { Footer } from "src/layout/Footer";
import { Navbar } from "src/layout/Navbar";
import Layout from "src/layout/Layout";
import { supabase } from "src/lib/api/supabase";
import useUser from "src/store/useUser";

Expand Down Expand Up @@ -60,6 +59,7 @@ export function AuthenticationForm(props: PaperProps) {
<form onSubmit={onSubmit}>
<Stack>
<TextInput
name="email"
required
label="Email"
placeholder="[email protected]"
Expand All @@ -69,6 +69,7 @@ export function AuthenticationForm(props: PaperProps) {
/>

<PasswordInput
name="password"
required
label="Password"
placeholder="∗∗∗∗∗∗∗∗∗∗∗"
Expand Down Expand Up @@ -190,11 +191,10 @@ const SignIn = () => {
}, [isReady, session, push, isPasswordReset]);

return (
<div>
<Layout>
<Head>
<title>Sign In - JSON Crack</title>
</Head>
<Navbar />
<Paper mt={50} shadow="xs" mx="auto" maw={400} p="lg" withBorder>
{isPasswordReset ? <ResetPassword /> : <AuthenticationForm />}
</Paper>
Expand All @@ -203,9 +203,7 @@ const SignIn = () => {
Don&apos;t have an account?
</Anchor>
</Center>

<Footer />
</div>
</Layout>
);
};

Expand Down

0 comments on commit 482de39

Please sign in to comment.