2024-08-27 10:09:41 -07:00
|
|
|
import Button from "react-bootstrap/Button"
|
|
|
|
import Form from "react-bootstrap/Form"
|
|
|
|
import Modal from "react-bootstrap/Modal"
|
2024-08-27 09:39:28 -07:00
|
|
|
|
2024-08-27 10:18:24 -07:00
|
|
|
import React, {useState} from "react"
|
2024-08-27 09:39:28 -07:00
|
|
|
|
2024-08-27 10:09:41 -07:00
|
|
|
type AuthProps = {
|
2024-08-27 11:11:54 -07:00
|
|
|
onLogin: (email: string, password: string) => void;
|
2024-08-27 10:09:41 -07:00
|
|
|
}
|
|
|
|
|
2024-08-27 11:11:54 -07:00
|
|
|
const AuthModal: React.FC<AuthProps> = ({ onLogin }) => {
|
2024-08-27 10:18:24 -07:00
|
|
|
const [email, setEmail] = useState("");
|
|
|
|
const [password, setPassword] = useState("");
|
|
|
|
|
2024-08-27 10:09:41 -07:00
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className="modal show"
|
|
|
|
style={{ display: "block", position: "initial" }}
|
|
|
|
>
|
|
|
|
<Modal.Dialog>
|
|
|
|
<Modal.Header closeButton>
|
|
|
|
<Modal.Title>Modal title</Modal.Title>
|
|
|
|
</Modal.Header>
|
|
|
|
|
|
|
|
<Modal.Body>
|
2024-08-27 11:11:54 -07:00
|
|
|
<Form onSubmit={(e) => {e.preventDefault(); onLogin(email, password)}}>
|
2024-08-27 10:09:41 -07:00
|
|
|
<Form.Group className="mb-3" controlId="formBasicEmail">
|
|
|
|
<Form.Label>Email address</Form.Label>
|
2024-08-27 10:18:24 -07:00
|
|
|
<Form.Control type="email" placeholder="Enter email" onChange={e => setEmail(e.target.value)}/>
|
2024-08-27 10:09:41 -07:00
|
|
|
<Form.Text className="text-muted">
|
|
|
|
We'll never share your email with anyone else.
|
|
|
|
</Form.Text>
|
|
|
|
</Form.Group>
|
2024-08-27 09:39:28 -07:00
|
|
|
|
2024-08-27 10:09:41 -07:00
|
|
|
<Form.Group className="mb-3" controlId="formBasicPassword">
|
|
|
|
<Form.Label>Password</Form.Label>
|
2024-08-27 10:18:24 -07:00
|
|
|
<Form.Control type="password" placeholder="Password" onChange={e => setPassword(e.target.value)}/>
|
2024-08-27 10:09:41 -07:00
|
|
|
</Form.Group>
|
2024-08-27 10:53:19 -07:00
|
|
|
<Button variant="primary" type="submit">Login</Button>
|
2024-08-27 10:09:41 -07:00
|
|
|
</Form>
|
|
|
|
</Modal.Body>
|
2024-08-27 09:39:28 -07:00
|
|
|
|
2024-08-27 10:09:41 -07:00
|
|
|
<Modal.Footer>
|
|
|
|
</Modal.Footer>
|
|
|
|
</Modal.Dialog>
|
|
|
|
</div>
|
|
|
|
);
|
2024-08-27 09:39:28 -07:00
|
|
|
}
|
|
|
|
export default AuthModal;
|