Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions src/app/auth/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@ import Input from "../components/Input";
import Link from "next/link";
import Button from "../components/button";

const Login = () => {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");

type RegisterInputProps = {
email: string;
password: string;
};

const Login = () => {
const [inputStates, setInputStates] = useState<RegisterInputProps>({
email: "",
password: "",
});

return (
<div className="container h-full text-black dark:text-white flex flex-col items-center justify-center">
Expand All @@ -21,16 +29,26 @@ const Login = () => {
<Input
type="email"
placeholder="Username"
value={email}
onChange={(e) => setEmail(e.target.value)} // Atualizar o valor de email
value={inputStates.email}
onChange={(e) =>
setInputStates((state) => ({
...state,
email: e.target.value,
}))
} // Atualizar o valor de email
/>
<Input
type="password"
placeholder="Password"
value={password}
onChange={(e) => setPassword(e.target.value)} // Atualizar o valor de password
value={inputStates.password}
onChange={(e) =>
setInputStates((state) => ({
...state,
password: e.target.value,
}))
} // Atualizar o valor de password
/>

<div className="text-sm mb-3 text-center">
<p className="text-gray-400 text-base">
Forgot Password?{" "}
Expand Down
22 changes: 18 additions & 4 deletions src/app/auth/resetpassword/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@ import React, { useState } from "react";
import Button from "../components/button";
import Input from "../components/Input";

function ResetPassword() {
const [email, setEmail] = useState("");

type RegisterInputProps = {
email: string;
};

const ResetPassword = () => {
const [inputStates, setInputStates] = useState<RegisterInputProps>({
email: "",
});

return (
<>
Expand All @@ -24,8 +31,15 @@ function ResetPassword() {
<Input
type="email"
placeholder="Enter your email"
value={email}
onChange={(e) => setEmail(e.target.value)} // Adicionar o onChange para atualizar o estado
value={inputStates.email}
onChange={(e) =>
setInputStates((state) => ({
...state,
email: e.target.value,
}))
} // Adicionar o onChange para atualizar o estado
className="w-full px-4 py-2 mb-6 bg-transparent border-0 border-b border-gray-600 focus:outline-none"

/>

<Button type="submit">Submit</Button>
Expand Down