source: frontend/src/Components/ProfilePage/DataForm.js@ efaa053

Last change on this file since efaa053 was 0f5aa27, checked in by darsov2 <62809499+darsov2@…>, 10 months ago

ouath, mailing impl

  • Property mode set to 100644
File size: 4.8 KB
Line 
1import React from "react";
2import { useState } from "react";
3import { Container, Row, Col, Form, Button, Modal } from "react-bootstrap";
4import { AiOutlineSave, AiOutlineKey } from "react-icons/ai";
5import ChangePasswordForm from "../Forms/ChangePasswordForm";
6
7const DataForm = (props) => {
8
9
10 const [show, setShow] = useState(false);
11
12 const handleClose = () => setShow(false);
13 const handleShow = (e) => {
14 e.preventDefault();
15 setShow(true);
16 }
17
18 return (
19 <>
20 <Container
21 className="w-75 rounded-5 m-5 my-auto mx-auto py-5 px-5"
22 style={{ backgroundColor: "#159895", color: "white" }}
23 >
24 <h2 className="mb-5" style={{ color: "white" }}>
25 Податоци за корисникот
26 </h2>
27 <Form>
28 <Row className="mb-3">
29 <Form.Group as={Col} controlId="name">
30 <Form.Label>Име</Form.Label>
31 <Form.Control type="text" value={props.data["name"]}
32 name={"name"}/>
33 </Form.Group>
34
35 <Form.Group as={Col} controlId="surname">
36 <Form.Label>Презиме</Form.Label>
37 <Form.Control
38 type="text"
39 placeholder=""
40 value={props.data["surname"]}
41 name={"surname"}
42 />
43 </Form.Group>
44 </Row>
45
46 <Row className="mb-3">
47 <Form.Group as={Col} controlId="name">
48 <Form.Label>Датум на раѓање</Form.Label>
49 <Form.Control type="date" value={props.data["dateOfBirth"]}
50 name={"dateOfBirth"}/>
51 </Form.Group>
52
53 <Form.Group as={Col} controlId="surname">
54 <Form.Label>Држава</Form.Label>
55 <Form.Control
56 type="text"
57 placeholder=""
58 value={props.data["country"]}
59 name={"country"}
60 />
61 </Form.Group>
62 </Row>
63
64 <Form.Group className="mb-3" controlId="address">
65 <Form.Label>Адреса</Form.Label>
66 <Form.Control type="text" value={props.data["address"]}
67 name={"address"}/>
68 </Form.Group>
69
70 <Row className="mb-3">
71 <Form.Group as={Col} controlId="city">
72 <Form.Label>Град</Form.Label>
73 <Form.Control type="text" value={props.data["city"]}
74 name={"city"}/>
75 </Form.Group>
76
77 <Form.Group as={Col} controlId="zip">
78 <Form.Label>Поштенски број</Form.Label>
79 <Form.Control
80 type="text"
81 placeholder=""
82 value={props.data["zip"]}
83 name={"zip"}
84 />
85 </Form.Group>
86 </Row>
87
88 <Row className="mb-5">
89 <Form.Group as={Col} controlId="email">
90 <Form.Label>Email</Form.Label>
91 <Form.Control type="email" value={props.data["email"]}
92 name={"email"}/>
93 </Form.Group>
94
95 <Form.Group as={Col} controlId="mobile">
96 <Form.Label>Телефонски број</Form.Label>
97 <Form.Control
98 type="text"
99 placeholder=""
100 value={props.data["mobile"]}
101 name={"mobile"}
102 />
103 </Form.Group>
104 </Row>
105
106 <Row>
107 <Col style={{textAlign: "right"}}>
108 <Button
109 type="submit"
110 style={{
111 backgroundColor: "#159895",
112 border: "2px solid white",
113 }}
114 size="md"
115 >
116 <span className="ikona my-1" color="white">
117 <AiOutlineSave style={{ color: "white" }} />
118 </span>
119 <span className="ikona mx-3">Зачувај промени</span>
120 </Button>
121 </Col>
122 <Col style={{textAlign: "left"}}>
123 <Button
124 type="submit"
125 style={{
126 backgroundColor: "#159895",
127 border: "2px solid white",
128 }}
129 size="md"
130 onClick={handleShow}
131 >
132 <span className="ikona my-1" color="white">
133 <AiOutlineKey style={{ color: "white" }} />
134 </span>
135 <span className="ikona mx-3">Промени лозинка</span>
136 </Button>
137 </Col>
138 </Row>
139 </Form>
140 </Container>
141
142 <Modal show={show} onHide={handleClose}>
143 <Modal.Header closeButton>
144 <Modal.Title style={{color: "#159895"}}>Промена на лозинка</Modal.Title>
145 </Modal.Header>
146 <Modal.Body><ChangePasswordForm></ChangePasswordForm></Modal.Body>
147 </Modal>
148 </>
149 );
150};
151
152export default DataForm;
Note: See TracBrowser for help on using the repository browser.