forked from ISM6225/Assignment_LookAndFeel
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCreateModal.js
More file actions
87 lines (85 loc) · 2.75 KB
/
CreateModal.js
File metadata and controls
87 lines (85 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import React, { useState } from "react";
import { Button, Form, Modal } from "react-bootstrap";
const CreateModal = ({ show, handleClose }) => {
const [formData, setFormData] = useState({
stateCode: "AL",
date: "",
positive: "",
recovered: "",
death: "",
});
const handleChange = (e) => {
setFormData({ ...formData, [e.target.name]: e.target.value });
};
return (
<Modal show={show} onHide={handleClose}>
<Modal.Header closeButton>
<Modal.Title>Update Data</Modal.Title>
</Modal.Header>
<Modal.Body>
<div className="">
<Form.Group className="mb-3" controlId="formBasicstate">
<Form.Label>State</Form.Label>
<Form.Control
onChange={handleChange}
name="stateCode"
value={formData?.stateCode}
type="text"
placeholder="Enter State"
disabled
/>
</Form.Group>
<Form.Group className="mb-3" controlId="formBasicDate">
<Form.Label>Date</Form.Label>
<Form.Control
onChange={handleChange}
name="date"
value={formData?.date}
type="date"
placeholder="Select Date"
/>
</Form.Group>
<Form.Group className="mb-3" controlId="formBasicPositive">
<Form.Label>Positive</Form.Label>
<Form.Control
onChange={handleChange}
name="positive"
value={formData?.positive}
type="text"
placeholder="Enter Positive"
/>
</Form.Group>
<Form.Group className="mb-3" controlId="formBasicRecovered">
<Form.Label>Recovered</Form.Label>
<Form.Control
onChange={handleChange}
name="recovered"
value={formData?.recovered}
type="text"
placeholder="Enter Recovered"
/>
</Form.Group>
<Form.Group className="mb-3" controlId="formBasicDeath">
<Form.Label>Death</Form.Label>
<Form.Control
onChange={handleChange}
name="death"
value={formData?.death}
type="text"
placeholder="Enter Death"
/>
</Form.Group>
</div>
</Modal.Body>
<div className="d-flex justify-content-end items-end m-2">
<Button variant="secondary" onClick={handleClose}>
Close
</Button>
<button className="delete-btn ms-2" onClick={handleClose}>
Confirm
</button>
</div>
</Modal>
);
};
export default CreateModal;