Changeset ac19a0c for frontend/src/Pages
- Timestamp:
- 01/13/24 23:19:50 (11 months ago)
- Branches:
- master
- Children:
- e85a562
- Parents:
- e9b4ba9
- Location:
- frontend/src/Pages
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Pages/HotelDetailsPage.js
re9b4ba9 rac19a0c 1 1 import React from "react"; 2 2 import LoginForm from "../Components/Login/LoginForm"; 3 import { Container, Row, Col, Form} from "react-bootstrap";3 import {Container, Row, Col, Form, FloatingLabel} from "react-bootstrap"; 4 4 import Navigation from "../Components/Layout/Navbar/Navigation"; 5 5 import Carousel from "react-bootstrap/Carousel"; … … 69 69 placeholder="Каде ќе патувате?:" 70 70 id="location" 71 value={data.hotelLocation} 71 72 ></Form.Control> 72 <label htmlFor="location">Локација:</label>73 <label style={{left: "10px"}} htmlFor="location">Локација:</label> 73 74 </Form.Floating> 74 75 </Row> … … 80 81 placeholder="Датум на пристигнување:" 81 82 id="dateFrom" 83 value={from} 82 84 ></Form.Control> 83 <label htmlFor="dateFrom">Датум на пристигнување:</label>85 <label style={{left: "10px"}} htmlFor="dateFrom">Датум на пристигнување:</label> 84 86 </Form.Floating> 85 87 </Row> … … 91 93 placeholder="Датум на заминување:" 92 94 id="dateTo" 95 value={to} 93 96 ></Form.Control> 94 <label htmlFor="dateTo">Датум на заминување:</label>97 <label style={{left: "10px"}} htmlFor="dateTo">Датум на заминување:</label> 95 98 </Form.Floating> 96 99 </Row> … … 103 106 id="floatingPassengers" 104 107 ></Form.Control> 105 <label htmlFor="floatingPassengers">Број на гости:</label>108 <label style={{left: "10px"}} htmlFor="floatingPassengers">Број на гости:</label> 106 109 </Form.Floating> 107 110 </Row> -
frontend/src/Pages/HotelEditPage.js
re9b4ba9 rac19a0c 1 import React, { useState} from "react";2 import { Container, Col, Row, Image} from "react-bootstrap";1 import React, {useState} from "react"; 2 import {Container, Col, Row, Image} from "react-bootstrap"; 3 3 import Navigation from "../Components/Layout/Navbar/Navigation"; 4 4 import ResourcesTab from "../Components/Resources/ResourcesTab"; 5 5 import HotelEditTab from "../Components/HotelEdit/HotelEditTab"; 6 6 import useGet from "../Components/Hooks/useGet"; 7 import { useParams } from "react-router-dom"; 7 import {Navigate, useParams} from "react-router-dom"; 8 import {useAuth} from "../Components/Context/AuthContext"; 8 9 9 10 10 11 const HotelEditPage = () => { 11 12 12 const params = useParams();13 const link = "/hotel/list/" + params.hotelId;14 const [changed, setChanged] = useState(0)15 const { data, setData, isLoading, getData} = useGet(link, changed);13 const params = useParams(); 14 const link = "/hotel/list/" + params.hotelId; 15 const [changed, setChanged] = useState(0) 16 const {data, setData, isLoading, getData} = useGet(link, changed); 16 17 17 18 18 console.log(data)19 return (20 <>21 <Navigation/>22 {!isLoading && <Container>23 <Row className="mb-5">24 <h2 style={{ color: "#159895", textAlign: "left"}}>Мои ресурси</h2>25 </Row>26 <Row className="mb-5">27 <Col>28 <Row className="d-flex mb-3">29 <Col30 className="d-flex justify-content-center"31 style={{ maxWidth: "30%"}}32 >33 <Image34 src="https://t3.ftcdn.net/jpg/05/16/27/58/360_F_516275801_f3Fsp17x6HQK0xQgDQEELoTuERO4SsWV.jpg"35 style={{36 height: "5em",37 borderRadius: "50%",38 maxWidth: "100%",39 }}40 className="m-auto"41 ></Image>42 </Col>43 <Col className="d-flex justify-content-center">44 <Container className="pt-2" style={{ textAlign: "left"}}>45 <h4>{data.hotelName}</h4>46 <h5>{data.hotelLocation}</h5>47 </Container>48 </Col>49 </Row>50 </Col>51 </Row>52 <Row>53 <HotelEditTab refresh={setChanged} displayRoom={data}/>54 </Row>55 </Container>}56 </>57 );19 console.log(data) 20 return ( 21 <> 22 <Navigation/> 23 {!isLoading && <Container> 24 <Row className="mb-5"> 25 <h2 style={{color: "#159895", textAlign: "left"}}>Мои ресурси</h2> 26 </Row> 27 <Row className="mb-5"> 28 <Col> 29 <Row className="d-flex mb-3"> 30 <Col 31 className="d-flex justify-content-center" 32 style={{maxWidth: "30%"}} 33 > 34 <Image 35 src="https://t3.ftcdn.net/jpg/05/16/27/58/360_F_516275801_f3Fsp17x6HQK0xQgDQEELoTuERO4SsWV.jpg" 36 style={{ 37 height: "5em", 38 borderRadius: "50%", 39 maxWidth: "100%", 40 }} 41 className="m-auto" 42 ></Image> 43 </Col> 44 <Col className="d-flex justify-content-center"> 45 <Container className="pt-2" style={{textAlign: "left"}}> 46 <h4>{data.hotelName}</h4> 47 <h5>{data.hotelLocation}</h5> 48 </Container> 49 </Col> 50 </Row> 51 </Col> 52 </Row> 53 <Row> 54 <HotelEditTab refresh={setChanged} displayRoom={data}/> 55 </Row> 56 </Container>} 57 </> 58 ); 58 59 }; 59 60 -
frontend/src/Pages/LoginErrorPage.js
re9b4ba9 rac19a0c 11 11 const [show, setShow] = useState(false); 12 12 const [changed, setChanged] = useState(0); 13 const {data, isLoading} = useGet("/username")14 13 const userId = localStorage.getItem("userId") 15 14 const [registered, setRegistered] = useState(false); -
frontend/src/Pages/LoginPage.js
re9b4ba9 rac19a0c 3 3 import { Container } from "react-bootstrap"; 4 4 import Navigation from "../Components/Layout/Navbar/Navigation"; 5 import {useAuth} from "../Components/Context/AuthContext"; 6 import {Navigate} from "react-router-dom"; 7 5 8 6 9 const LoginPage = () => { … … 8 11 document.body.style.marginTop = "auto"; 9 12 document.body.style.marginBottom = "auto"; 13 14 const Auth = useAuth(); 15 const isLoggedIn = Auth.userIsAuthenticated(); 16 17 if (isLoggedIn) { 18 return <Navigate to={'/home'}/> 19 } 20 10 21 return ( 11 22 <> -
frontend/src/Pages/NoBusinessRegisteredError.js
re9b4ba9 rac19a0c 6 6 import RegisterBusinessForm from "../Components/Forms/RegisterBusinessForm"; 7 7 import useGet from "../Components/Hooks/useGet"; 8 import { useNavigate } from "react-router-dom"; 8 import {Navigate, useNavigate} from "react-router-dom"; 9 import {useAuth} from "../Components/Context/AuthContext"; 9 10 10 11 const NoBusinessRegisteredError = (props) => { 11 12 const [show, setShow] = useState(false); 12 13 const [changed, setChanged] = useState(0); 13 const {data, isLoading} = useGet("/username") 14 const Auth = useAuth(); 15 const isLoggedIn = Auth.userIsAuthenticated(); 14 16 const userId = localStorage.getItem("userId") 15 17 const [registered, setRegistered] = useState(false); … … 45 47 46 48 47 console.log(data) 49 if(!isLoggedIn) 50 { 51 return <Navigate to={'/login'}/> 52 } 48 53 49 !isLoading && !data && navigator("/login")50 54 !firmaIsLoading && firma && firma.length > 0 && firma[0].approved && navigator("/resources/hotel") 51 55 -
frontend/src/Pages/ProfilePage.js
re9b4ba9 rac19a0c 8 8 import ChangePasswordForm from "../Components/Forms/ChangePasswordForm"; 9 9 import useGet from "../Components/Hooks/useGet"; 10 import {useAuth} from "../Components/Context/AuthContext"; 11 import {Navigate} from "react-router-dom"; 10 12 11 13 const ProfilePage = () => { 12 14 13 const { data, setData, isLoading, getData } = useGet("/principal");15 const { data, setData, isLoading, getData } = useGet("/principal"); 14 16 15 17 18 16 19 const profileData = { 17 20 "name": "Марко", … … 19 22 "address": "ул. Раскрсница бр. 10", 20 23 "dateOfBirth": "2002-01-01", 21 "country": " Никогаш Северна само МАКЕДОНИЈА",24 "country": "Македонија", 22 25 "zip": "1000", 23 26 "city": "Скопје", … … 27 30 28 31 32 29 33 return ( 30 34 <> 31 35 <Navigation /> 32 {!isLoading && <Container>36 {!isLoading && <Container> 33 37 <Row className="mb-5"> 34 38 <h2 style={{ color: "#159895", textAlign: "left" }}>Мојот профил</h2> -
frontend/src/Pages/ResourcesPage.js
re9b4ba9 rac19a0c 1 1 import React from "react"; 2 import { Container, Col, Row, Image} from "react-bootstrap";2 import {Container, Col, Row, Image} from "react-bootstrap"; 3 3 import Navigation from "../Components/Layout/Navbar/Navigation"; 4 4 import ResourcesTab from "../Components/Resources/ResourcesTab"; 5 import { useState} from "react";5 import {useState} from "react"; 6 6 import useGet from "../Components/Hooks/useGet"; 7 import {useAuth} from "../Components/Context/AuthContext"; 8 import {Navigate} from "react-router-dom"; 7 9 8 10 const ResourcesPage = (props) => { 9 11 10 console.log(props.tab)11 const { data, setData, isLoading, getData } = useGet("/principal");12 const Auth = useAuth(); 13 const user = Auth.getUser(); 12 14 13 14 return ( 15 <> 16 <Navigation /> 17 {!isLoading && <Container> 18 <Row className="mb-5"> 19 <h2 style={{ color: "#159895", textAlign: "left" }}>Мои ресурси</h2> 20 </Row> 21 <Row className="mb-5"> 22 <Col> 23 <Row className="d-flex mb-3"> 24 <Col 25 className="d-flex justify-content-center" 26 style={{ maxWidth: "30%" }} 27 > 28 <Image 29 src="https://t3.ftcdn.net/jpg/05/16/27/58/360_F_516275801_f3Fsp17x6HQK0xQgDQEELoTuERO4SsWV.jpg" 30 style={{ 31 height: "5em", 32 borderRadius: "50%", 33 maxWidth: "100%", 34 }} 35 className="m-auto" 36 ></Image> 37 </Col> 38 <Col className="d-flex justify-content-center"> 39 <Container className="pt-2" style={{ textAlign: "left" }}> 40 <h4>{data.name + " " + data.surname}</h4> 41 <h5>{data.email}</h5> 42 </Container> 43 </Col> 44 </Row> 45 </Col> 46 </Row> 47 <Row> 48 <ResourcesTab tab={props.tab}></ResourcesTab> 49 </Row> 50 </Container>} 51 </> 52 ); 15 return ( 16 <> 17 <Navigation/> 18 {<Container> 19 <Row className="mb-5"> 20 <h2 style={{color: "#159895", textAlign: "left"}}>Мои ресурси</h2> 21 </Row> 22 <Row className="mb-5"> 23 <Col> 24 <Row className="d-flex mb-3"> 25 <Col 26 className="d-flex justify-content-center" 27 style={{maxWidth: "30%"}} 28 > 29 <Image 30 src="https://t3.ftcdn.net/jpg/05/16/27/58/360_F_516275801_f3Fsp17x6HQK0xQgDQEELoTuERO4SsWV.jpg" 31 style={{ 32 height: "5em", 33 borderRadius: "50%", 34 maxWidth: "100%", 35 }} 36 className="m-auto" 37 ></Image> 38 </Col> 39 <Col className="d-flex justify-content-center"> 40 <Container className="pt-2" style={{textAlign: "left"}}> 41 <h4>{user.name + " " + user.surname}</h4> 42 <h5>{user.username}</h5> 43 </Container> 44 </Col> 45 </Row> 46 </Col> 47 </Row> 48 <Row> 49 <ResourcesTab tab={props.tab}></ResourcesTab> 50 </Row> 51 </Container>} 52 </> 53 ); 53 54 }; 54 55 -
frontend/src/Pages/RestaurantEditPage.js
re9b4ba9 rac19a0c 6 6 import RestaurantEditTab from "../Components/RestaurantEdit/RestaurantEditTab"; 7 7 import useGet from "../Components/Hooks/useGet"; 8 import { useParams, useSearchParams } from "react-router-dom"; 8 import {Navigate, useParams, useSearchParams} from "react-router-dom"; 9 import {useAuth} from "../Components/Context/AuthContext"; 9 10 10 11 const RestaurantEditPage = () => { -
frontend/src/Pages/SearchPage.js
re9b4ba9 rac19a0c 11 11 import BecomeAHost from "../Components/BecomeAHost/BecomeAHost" 12 12 import HotelLisitng from "../Components/Listings/HotelListing" 13 import SearchCriterias from "../Components/SearchCriterias/SearchCriteriasBar";13 import SearchCriteriasHotel from "../Components/SearchCriterias/SearchCriteriasHotel"; 14 14 import SortButton from "../Components/Listings/SortButton"; 15 15 import FilterButton from "../Components/Listings/FilterButton"; … … 17 17 import useGet from "../Components/Hooks/useGet"; 18 18 import { useParams } from "react-router-dom"; 19 import SearchCriteriasBar from "../Components/SearchCriterias/SearchCriteriasBar"; 19 20 20 21 … … 36 37 } 37 38 38 let link = props.type === "transport" ? `/transport/search?from=${params.from}&to=${params.to}&date=${params.date} ` : props.type === "hotel" ? `/hotel/search?hotelLocation=${params.hotelLocation}&dateFrom=${params.dateFrom}&dateTo=${params.dateTo}&numBeds=${params.numBeds}` : ""39 let link = props.type === "transport" ? `/transport/search?from=${params.from}&to=${params.to}&date=${params.date}&numPassengers=${params.numPassengers}` : props.type === "hotel" ? `/hotel/search?hotelLocation=${params.hotelLocation}&dateFrom=${params.dateFrom}&dateTo=${params.dateTo}&numBeds=${params.numBeds}` : "" 39 40 console.log(link) 40 41 const { data, isLoading, getData, setData } = useGet(link); … … 43 44 <> 44 45 <Navigation></Navigation> 45 <SearchCriterias criterias={useParams()}></SearchCriterias>46 <SearchCriteriasBar type={props.type} criterias={useParams()}></SearchCriteriasBar> 46 47 <Container className="d-flex justify-content-end gx-5" style={{maxWidth: "60%"}}> 47 48 <Row> -
frontend/src/Pages/TransportEditPage.js
re9b4ba9 rac19a0c 1 import React, { useState} from "react";2 import { Container, Col, Row, Image} from "react-bootstrap";1 import React, {useState} from "react"; 2 import {Container, Col, Row, Image} from "react-bootstrap"; 3 3 import Navigation from "../Components/Layout/Navbar/Navigation"; 4 4 import ResourcesTab from "../Components/Resources/ResourcesTab"; … … 7 7 import TransportEditTab from "../Components/TransportEdit/TransportEditTab"; 8 8 import useGet from "../Components/Hooks/useGet"; 9 import { useParams } from "react-router-dom"; 9 import {Navigate, useParams} from "react-router-dom"; 10 import {useAuth} from "../Components/Context/AuthContext"; 10 11 11 12 const TransportEditPage = () => { 12 const params = useParams();13 console.log("transportot ima id " + params.transportId);14 const link = "/transport/" + params.transportId;15 const [changed, setChanged] = useState(0);16 const { data, setData, isLoading, getData } = useGet(link, changed);17 13 18 !isLoading && console.log(data)14 const params = useParams(); 19 15 20 return ( 21 <> 22 <Navigation /> 23 {!isLoading && ( 24 <Container> 25 <Row className="mb-5"> 26 <h2 style={{ color: "#159895", textAlign: "left" }}>Мои ресурси</h2> 27 </Row> 28 <Row className="mb-5"> 29 <Col> 30 <Row className="d-flex mb-3"> 31 <Col 32 className="d-flex justify-content-center" 33 style={{ maxWidth: "30%" }} 34 > 35 <Image 36 src="https://t3.ftcdn.net/jpg/05/16/27/58/360_F_516275801_f3Fsp17x6HQK0xQgDQEELoTuERO4SsWV.jpg" 37 style={{ 38 height: "5em", 39 borderRadius: "50%", 40 maxWidth: "100%", 41 }} 42 className="m-auto" 43 ></Image> 44 </Col> 45 <Col className="d-flex justify-content-center"> 46 <Container className="pt-2" style={{ textAlign: "left" }}> 47 <h4>{data.transportName}</h4> 48 <h5>{data.carBrand + " " + data.carType}</h5> 49 </Container> 50 </Col> 51 </Row> 52 </Col> 53 </Row> 54 <Row> 55 {data && <TransportEditTab displayRoute={data} refresh={setChanged}/>} 56 </Row> 57 </Container> 58 )} 59 </> 60 ); 16 const link = "/transport/" + params.transportId; 17 18 const {data, setData, isLoading, getData, setChanged} = useGet(link); 19 20 !isLoading && console.log(data) 21 22 return ( 23 <> 24 <Navigation/> 25 {!isLoading && ( 26 <Container> 27 <Row className="mb-5"> 28 <h2 style={{color: "#159895", textAlign: "left"}}>Мои ресурси</h2> 29 </Row> 30 <Row className="mb-5"> 31 <Col> 32 <Row className="d-flex mb-3"> 33 <Col 34 className="d-flex justify-content-center" 35 style={{maxWidth: "30%"}} 36 > 37 <Image 38 src="https://t3.ftcdn.net/jpg/05/16/27/58/360_F_516275801_f3Fsp17x6HQK0xQgDQEELoTuERO4SsWV.jpg" 39 style={{ 40 height: "5em", 41 borderRadius: "50%", 42 maxWidth: "100%", 43 }} 44 className="m-auto" 45 ></Image> 46 </Col> 47 <Col className="d-flex justify-content-center"> 48 <Container className="pt-2" style={{textAlign: "left"}}> 49 <h4>{data.transportName}</h4> 50 <h5>{data.carBrand + " " + data.carType}</h5> 51 </Container> 52 </Col> 53 </Row> 54 </Col> 55 </Row> 56 <Row> 57 {data && <TransportEditTab displayRoute={data} refresh={setChanged}/>} 58 </Row> 59 </Container> 60 )} 61 </> 62 ); 61 63 }; 62 64
Note:
See TracChangeset
for help on using the changeset viewer.