forked from expertiza/reimplementation-front-end
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Modal.jsx
63 lines (60 loc) · 2 KB
/
Modal.jsx
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
import React from "react";
import { Button, Col, Container, Modal, Row, Form } from "react-bootstrap";
function EditModal(props) {
return (
<Modal show={props.showModal} onHide={props.handleCloseModal}>
<Modal.Header closeButton>
<Modal.Title>Edit Row</Modal.Title>
</Modal.Header>
<Modal.Body>
<Form>
<Form.Group controlId="name">
<Form.Label>Name</Form.Label>
<Form.Control
type="text"
placeholder="Enter Name"
defaultValue={props.editRowData[0]}
onChange={(e) => props.handleInputChange(e, 0)}
/>
</Form.Group>
<Form.Group controlId="institution">
<Form.Label>Institution</Form.Label>
<Form.Control
type="text"
placeholder="Enter Institution"
defaultValue={props.editRowData[1]}
onChange={(e) => props.handleInputChange(e, 1)}
/>
</Form.Group>
<Form.Group controlId="creationDate">
<Form.Label>Creation Date</Form.Label>
<Form.Control
type="text"
placeholder="Enter Creation Date"
defaultValue={props.editRowData[2]}
onChange={(e) => props.handleInputChange(e, 2)}
/>
</Form.Group>
<Form.Group controlId="updatedDate">
<Form.Label>Updated Date</Form.Label>
<Form.Control
type="text"
placeholder="Enter Updated Date"
defaultValue={props.editRowData[3]}
onChange={(e) => props.handleInputChange(e, 3)}
/>
</Form.Group>
</Form>
</Modal.Body>
<Modal.Footer>
<Button variant="secondary" onClick={props.handleCloseModal}>
Close
</Button>
<Button variant="primary" onClick={props.handleSaveEdit}>
Save Changes
</Button>
</Modal.Footer>
</Modal>
);
}
export default EditModal;