Last change
on this file since 0f5aa27 was 07f4e8b, checked in by darsov2 <62809499+darsov2@…>, 10 months ago |
prefinal fixes
|
-
Property mode
set to
100644
|
File size:
2.7 KB
|
Line | |
---|
1 | import React from "react";
|
---|
2 | import { Button, Col, Container, Form, Row } from "react-bootstrap";
|
---|
3 | import { HiMagnifyingGlass } from "react-icons/hi2"
|
---|
4 | import useFormData from "../Hooks/useFormData";
|
---|
5 |
|
---|
6 | function TabFormTransport() {
|
---|
7 |
|
---|
8 | const { formData, onFormChange, setFormData } = useFormData({
|
---|
9 | from: undefined,
|
---|
10 | to: undefined,
|
---|
11 | date: undefined,
|
---|
12 | numPassengers: 0
|
---|
13 | })
|
---|
14 |
|
---|
15 | return (
|
---|
16 | <Form>
|
---|
17 | <Row>
|
---|
18 | <Col>
|
---|
19 | <Form.Floating className="mb-3">
|
---|
20 | <Form.Control
|
---|
21 | size="md"
|
---|
22 | type="text"
|
---|
23 | placeholder="Од:"
|
---|
24 | id="floatingFrom"
|
---|
25 | value={formData.from}
|
---|
26 | name={'from'}
|
---|
27 | onChange={onFormChange}
|
---|
28 | ></Form.Control>
|
---|
29 | <label htmlFor="floatingFrom">Од:</label>
|
---|
30 | </Form.Floating>
|
---|
31 | </Col>
|
---|
32 | <Col>
|
---|
33 | <Form.Floating className="mb-3">
|
---|
34 | <Form.Control
|
---|
35 | size="md"
|
---|
36 | type="text"
|
---|
37 | placeholder="До:"
|
---|
38 | id="floatingTo"
|
---|
39 | name={'to'}
|
---|
40 | value={formData.to}
|
---|
41 | onChange={onFormChange}
|
---|
42 | ></Form.Control>
|
---|
43 | <label htmlFor="floatingTo">До:</label>
|
---|
44 | </Form.Floating>
|
---|
45 | </Col>
|
---|
46 | <Col>
|
---|
47 | <Form.Floating className="mb-3">
|
---|
48 | <Form.Control
|
---|
49 | size="md"
|
---|
50 | type="date"
|
---|
51 | placeholder="Датум:"
|
---|
52 | id="floatingDate"
|
---|
53 | name={'date'}
|
---|
54 | value={formData.date}
|
---|
55 | onChange={onFormChange}
|
---|
56 | ></Form.Control>
|
---|
57 | <label htmlFor="floatingDate">Датум:</label>
|
---|
58 | </Form.Floating>
|
---|
59 | </Col>
|
---|
60 | <Col>
|
---|
61 | <Form.Floating className="mb-3">
|
---|
62 | <Form.Control
|
---|
63 | size="md"
|
---|
64 | type="number"
|
---|
65 | placeholder="Број на патници:"
|
---|
66 | name={'numPassengers'}
|
---|
67 | id="floatingPassengers"
|
---|
68 | value={formData.numPassengers}
|
---|
69 | onChange={onFormChange}
|
---|
70 | ></Form.Control>
|
---|
71 | <label htmlFor="floatingPassengers">Број на патници:</label>
|
---|
72 | </Form.Floating>
|
---|
73 | <Form.Group className="my-1">
|
---|
74 | <Button type="submit" style={{backgroundColor: "#159895"}} size="lg" onClick={(e) => {
|
---|
75 | e.preventDefault();
|
---|
76 | window.location.href = `/search/transport/${formData.from}/${formData.to}/${formData.date}/${formData.numPassengers}`
|
---|
77 | }}>
|
---|
78 | <span className="ikona my-1"><HiMagnifyingGlass/></span>
|
---|
79 | <span className="ikona mx-3">Пребарај</span>
|
---|
80 | </Button>
|
---|
81 | </Form.Group>
|
---|
82 | </Col>
|
---|
83 | </Row>
|
---|
84 | </Form>
|
---|
85 | );
|
---|
86 | }
|
---|
87 |
|
---|
88 | export default TabFormTransport;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.