mirror of
https://github.com/cssgunc/compass.git
synced 2025-04-10 06:10:17 -04:00
Fix errors, cleanup code, remove unused lines
This commit is contained in:
parent
2a495b89fa
commit
a18cbb48cb
|
@ -5,13 +5,8 @@ import Button from '@/components/Button';
|
||||||
import Input from '@/components/Input'
|
import Input from '@/components/Input'
|
||||||
import InlineLink from '@/components/InlineLink';
|
import InlineLink from '@/components/InlineLink';
|
||||||
import Paper from '@/components/auth/Paper';
|
import Paper from '@/components/auth/Paper';
|
||||||
// import { Metadata } from 'next'
|
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import {ChangeEvent, useState} from "react";
|
import {ChangeEvent, useState} from "react";
|
||||||
|
|
||||||
// export const metadata: Metadata = {
|
|
||||||
// title: 'Login',
|
|
||||||
// }
|
|
||||||
import PasswordInput from '@/components/auth/PasswordInput';
|
import PasswordInput from '@/components/auth/PasswordInput';
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
|
@ -21,33 +16,31 @@ export default function Page() {
|
||||||
|
|
||||||
const handleEmailChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handleEmailChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
setEmail(event.currentTarget.value);
|
setEmail(event.currentTarget.value);
|
||||||
console.log("email " + email);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handlePasswordChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handlePasswordChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
setPassword(event.currentTarget.value);
|
setPassword(event.currentTarget.value);
|
||||||
console.log("password " + password)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
||||||
event.preventDefault();
|
|
||||||
// Priority: Incorrect combo > Missing email > Missing password
|
// Priority: Incorrect combo > Missing email > Missing password
|
||||||
|
|
||||||
if (password.trim().length === 0) {
|
if (password.trim().length === 0) {
|
||||||
setError("Please enter your password.")
|
setError("Please enter your password.")
|
||||||
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
// This shouldn't happen, <input type="email"> already provides validation, but just in case.
|
// This shouldn't happen, <input type="email"> already provides validation, but just in case.
|
||||||
if (email.trim().length === 0) {
|
if (email.trim().length === 0) {
|
||||||
setError("Please enter your email.")
|
setError("Please enter your email.")
|
||||||
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
// Placeholder for incorrect email + password combo.
|
// Placeholder for incorrect email + password combo.
|
||||||
if (email === "incorrect@gmail.com" && password) {
|
if (email === "incorrect@gmail.com" && password) {
|
||||||
setError("Incorrect password.")
|
setError("Incorrect password.")
|
||||||
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Paper>
|
<Paper>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user