source: frontend/src/Components/HotelEdit/HotelEditForm.js@ 0f5aa27

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

images upload/download impl, other fixes

  • Property mode set to 100644
File size: 3.3 KB
Line 
1import React from "react";
2import { Form, Button, Container } from "react-bootstrap";
3import { GiConfirmed } from "react-icons/gi";
4import useFormData from "../Hooks/useFormData";
5
6const HotelEditForm = (props) => {
7 console.log(props.hotel);
8
9 const { formData, onFormChange, onCheckBoxChange, setFormData } = useFormData(
10 {...props.hotel}
11 );
12
13 return (
14 <>
15 <Container
16 className="rounded-5 m-5 my-auto mx-auto py-2 px-5"
17 style={{ backgroundColor: "#ffffff" }}
18 >
19 <Form>
20 <Form.Group className="mb-3" controlId="hotelName">
21 <Form.Label>Име на сместувањето</Form.Label>
22 <Form.Control
23 type="text"
24 placeholder="Внесете го името на сместувањето"
25 name="hotelName"
26 value={formData.hotelName}
27 onChange={onFormChange}
28 />
29 </Form.Group>
30
31 <Form.Group className="mb-3" controlId="hotelDescription">
32 <Form.Label>Опис</Form.Label>
33 <Form.Control
34 as="textarea"
35 placeholder="Внесете опис на сместувањето"
36 name="hotelDescripiton"
37 value={formData.hotelDescripiton}
38 onChange={onFormChange}
39 />
40 </Form.Group>
41
42 <Form.Group className="mb-3" controlId="hotelAddress">
43 <Form.Label>Локација</Form.Label>
44 <Form.Control
45 type="text"
46 placeholder="Внесете ја адресата на сместувањето"
47 name="hotelLocation"
48 value={formData.hotelLocation}
49 onChange={onFormChange}
50 />
51 </Form.Group>
52
53 <Form.Group className="mb-3" controlId="hotelFilters">
54 <Form.Label>Филтри</Form.Label>
55 <Form.Check
56 type="checkbox"
57 label="Паркинг"
58 name="parking"
59 checked={formData.parking}
60 onChange={onCheckBoxChange}
61 />
62 <Form.Check
63 type="checkbox"
64 label="Pet friendly"
65 name="petFriendly"
66 checked={formData.petFriendly}
67 onChange={onCheckBoxChange}
68 />
69 <Form.Check
70 type="checkbox"
71 label="Интернет"
72 name="internetAvailable"
73 checked={formData.internetAvailable}
74 onChange={onCheckBoxChange}
75 />
76 </Form.Group>
77
78 <Form.Group className="mb-3" controlId="hotelPhone">
79 <Form.Label>Контакт телефон</Form.Label>
80 <Form.Control type="text" placeholder="Внесете контакт телефон" />
81 </Form.Group>
82
83 <Form.Group className="my-1 justify-content-center">
84 <Button
85 type="submit"
86 style={{ backgroundColor: "#159895" }}
87 size="md"
88 >
89 <span className="ikona my-1">
90 <GiConfirmed />
91 </span>
92 <span className="ikona mx-3">Зачувај промени</span>
93 </Button>
94 </Form.Group>
95 </Form>
96 </Container>
97 </>
98 );
99};
100
101export default HotelEditForm;
Note: See TracBrowser for help on using the repository browser.