Skip to content

Commit 86bb15b

Browse files
committed
lint
1 parent ae449da commit 86bb15b

File tree

2 files changed

+114
-114
lines changed

2 files changed

+114
-114
lines changed

app/(auth)/login/page.tsx

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -11,67 +11,67 @@ import { toast } from "@/components/toast";
1111
import { type LoginActionState, login } from "../actions";
1212

1313
export default function Page() {
14-
const router = useRouter();
14+
const router = useRouter();
1515

16-
const [email, setEmail] = useState("");
17-
const [isSuccessful, setIsSuccessful] = useState(false);
16+
const [email, setEmail] = useState("");
17+
const [isSuccessful, setIsSuccessful] = useState(false);
1818

19-
const [state, formAction] = useActionState<LoginActionState, FormData>(
20-
login,
21-
{
22-
status: "idle",
23-
},
24-
);
19+
const [state, formAction] = useActionState<LoginActionState, FormData>(
20+
login,
21+
{
22+
status: "idle",
23+
}
24+
);
2525

26-
const { update: updateSession } = useSession();
26+
const { update: updateSession } = useSession();
2727

28-
useEffect(() => {
29-
if (state.status === "failed") {
30-
toast({
31-
type: "error",
32-
description: "Invalid credentials!",
33-
});
34-
} else if (state.status === "invalid_data") {
35-
toast({
36-
type: "error",
37-
description: "Failed validating your submission!",
38-
});
39-
} else if (state.status === "success") {
40-
setIsSuccessful(true);
41-
updateSession();
42-
router.refresh();
43-
}
44-
// eslint-disable-next-line react-hooks/exhaustive-deps
45-
}, [state.status]);
28+
useEffect(() => {
29+
if (state.status === "failed") {
30+
toast({
31+
type: "error",
32+
description: "Invalid credentials!",
33+
});
34+
} else if (state.status === "invalid_data") {
35+
toast({
36+
type: "error",
37+
description: "Failed validating your submission!",
38+
});
39+
} else if (state.status === "success") {
40+
setIsSuccessful(true);
41+
updateSession();
42+
router.refresh();
43+
}
44+
// eslint-disable-next-line react-hooks/exhaustive-deps
45+
}, [state.status]);
4646

47-
const handleSubmit = (formData: FormData) => {
48-
setEmail(formData.get("email") as string);
49-
formAction(formData);
50-
};
47+
const handleSubmit = (formData: FormData) => {
48+
setEmail(formData.get("email") as string);
49+
formAction(formData);
50+
};
5151

52-
return (
53-
<div className="flex h-dvh w-screen items-start justify-center bg-background pt-12 md:items-center md:pt-0">
54-
<div className="flex w-full max-w-md flex-col gap-12 overflow-hidden rounded-2xl">
55-
<div className="flex flex-col items-center justify-center gap-2 px-4 text-center sm:px-16">
56-
<h3 className="font-semibold text-xl dark:text-zinc-50">Sign In</h3>
57-
<p className="text-gray-500 text-sm dark:text-zinc-400">
58-
Use your email and password to sign in
59-
</p>
60-
</div>
61-
<AuthForm action={handleSubmit} defaultEmail={email}>
62-
<SubmitButton isSuccessful={isSuccessful}>Sign in</SubmitButton>
63-
<p className="mt-4 text-center text-gray-600 text-sm dark:text-zinc-400">
64-
{"Don't have an account? "}
65-
<Link
66-
className="font-semibold text-gray-800 hover:underline dark:text-zinc-200"
67-
href="/register"
68-
>
69-
Sign up
70-
</Link>
71-
{" for free."}
72-
</p>
73-
</AuthForm>
74-
</div>
75-
</div>
76-
);
52+
return (
53+
<div className="flex h-dvh w-screen items-start justify-center bg-background pt-12 md:items-center md:pt-0">
54+
<div className="flex w-full max-w-md flex-col gap-12 overflow-hidden rounded-2xl">
55+
<div className="flex flex-col items-center justify-center gap-2 px-4 text-center sm:px-16">
56+
<h3 className="font-semibold text-xl dark:text-zinc-50">Sign In</h3>
57+
<p className="text-gray-500 text-sm dark:text-zinc-400">
58+
Use your email and password to sign in
59+
</p>
60+
</div>
61+
<AuthForm action={handleSubmit} defaultEmail={email}>
62+
<SubmitButton isSuccessful={isSuccessful}>Sign in</SubmitButton>
63+
<p className="mt-4 text-center text-gray-600 text-sm dark:text-zinc-400">
64+
{"Don't have an account? "}
65+
<Link
66+
className="font-semibold text-gray-800 hover:underline dark:text-zinc-200"
67+
href="/register"
68+
>
69+
Sign up
70+
</Link>
71+
{" for free."}
72+
</p>
73+
</AuthForm>
74+
</div>
75+
</div>
76+
);
7777
}

app/(auth)/register/page.tsx

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -10,68 +10,68 @@ import { toast } from "@/components/toast";
1010
import { type RegisterActionState, register } from "../actions";
1111

1212
export default function Page() {
13-
const router = useRouter();
13+
const router = useRouter();
1414

15-
const [email, setEmail] = useState("");
16-
const [isSuccessful, setIsSuccessful] = useState(false);
15+
const [email, setEmail] = useState("");
16+
const [isSuccessful, setIsSuccessful] = useState(false);
1717

18-
const [state, formAction] = useActionState<RegisterActionState, FormData>(
19-
register,
20-
{
21-
status: "idle",
22-
},
23-
);
18+
const [state, formAction] = useActionState<RegisterActionState, FormData>(
19+
register,
20+
{
21+
status: "idle",
22+
}
23+
);
2424

25-
const { update: updateSession } = useSession();
25+
const { update: updateSession } = useSession();
2626

27-
useEffect(() => {
28-
if (state.status === "user_exists") {
29-
toast({ type: "error", description: "Account already exists!" });
30-
} else if (state.status === "failed") {
31-
toast({ type: "error", description: "Failed to create account!" });
32-
} else if (state.status === "invalid_data") {
33-
toast({
34-
type: "error",
35-
description: "Failed validating your submission!",
36-
});
37-
} else if (state.status === "success") {
38-
toast({ type: "success", description: "Account created successfully!" });
27+
useEffect(() => {
28+
if (state.status === "user_exists") {
29+
toast({ type: "error", description: "Account already exists!" });
30+
} else if (state.status === "failed") {
31+
toast({ type: "error", description: "Failed to create account!" });
32+
} else if (state.status === "invalid_data") {
33+
toast({
34+
type: "error",
35+
description: "Failed validating your submission!",
36+
});
37+
} else if (state.status === "success") {
38+
toast({ type: "success", description: "Account created successfully!" });
3939

40-
setIsSuccessful(true);
41-
updateSession();
42-
router.refresh();
43-
}
44-
// eslint-disable-next-line react-hooks/exhaustive-deps
45-
}, [state.status]);
40+
setIsSuccessful(true);
41+
updateSession();
42+
router.refresh();
43+
}
44+
// eslint-disable-next-line react-hooks/exhaustive-deps
45+
}, [state.status]);
4646

47-
const handleSubmit = (formData: FormData) => {
48-
setEmail(formData.get("email") as string);
49-
formAction(formData);
50-
};
47+
const handleSubmit = (formData: FormData) => {
48+
setEmail(formData.get("email") as string);
49+
formAction(formData);
50+
};
5151

52-
return (
53-
<div className="flex h-dvh w-screen items-start justify-center bg-background pt-12 md:items-center md:pt-0">
54-
<div className="flex w-full max-w-md flex-col gap-12 overflow-hidden rounded-2xl">
55-
<div className="flex flex-col items-center justify-center gap-2 px-4 text-center sm:px-16">
56-
<h3 className="font-semibold text-xl dark:text-zinc-50">Sign Up</h3>
57-
<p className="text-gray-500 text-sm dark:text-zinc-400">
58-
Create an account with your email and password
59-
</p>
60-
</div>
61-
<AuthForm action={handleSubmit} defaultEmail={email}>
62-
<SubmitButton isSuccessful={isSuccessful}>Sign Up</SubmitButton>
63-
<p className="mt-4 text-center text-gray-600 text-sm dark:text-zinc-400">
64-
{"Already have an account? "}
65-
<Link
66-
className="font-semibold text-gray-800 hover:underline dark:text-zinc-200"
67-
href="/login"
68-
>
69-
Sign in
70-
</Link>
71-
{" instead."}
72-
</p>
73-
</AuthForm>
74-
</div>
75-
</div>
76-
);
52+
return (
53+
<div className="flex h-dvh w-screen items-start justify-center bg-background pt-12 md:items-center md:pt-0">
54+
<div className="flex w-full max-w-md flex-col gap-12 overflow-hidden rounded-2xl">
55+
<div className="flex flex-col items-center justify-center gap-2 px-4 text-center sm:px-16">
56+
<h3 className="font-semibold text-xl dark:text-zinc-50">Sign Up</h3>
57+
<p className="text-gray-500 text-sm dark:text-zinc-400">
58+
Create an account with your email and password
59+
</p>
60+
</div>
61+
<AuthForm action={handleSubmit} defaultEmail={email}>
62+
<SubmitButton isSuccessful={isSuccessful}>Sign Up</SubmitButton>
63+
<p className="mt-4 text-center text-gray-600 text-sm dark:text-zinc-400">
64+
{"Already have an account? "}
65+
<Link
66+
className="font-semibold text-gray-800 hover:underline dark:text-zinc-200"
67+
href="/login"
68+
>
69+
Sign in
70+
</Link>
71+
{" instead."}
72+
</p>
73+
</AuthForm>
74+
</div>
75+
</div>
76+
);
7777
}

0 commit comments

Comments
 (0)