Changeset 5528b99 for frontend/src/Pages
- Timestamp:
- 01/16/24 16:34:03 (11 months ago)
- Branches:
- master
- Children:
- 07f4e8b
- Parents:
- e6c2521
- Location:
- frontend/src/Pages
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Pages/HotelDetailsPage.js
re6c2521 r5528b99 1 1 import React from "react"; 2 2 import LoginForm from "../Components/Login/LoginForm"; 3 <<<<<<< HEAD 3 4 import {Container, Row, Col, Form, FloatingLabel, Modal, Button} from "react-bootstrap"; 5 ======= 6 import { Container, Row, Col, Form } from "react-bootstrap"; 7 >>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl) 4 8 import Navigation from "../Components/Layout/Navbar/Navigation"; 5 9 import Carousel from "react-bootstrap/Carousel"; … … 69 73 placeholder="Каде ќе патувате?:" 70 74 id="location" 71 value={data.hotelLocation}72 75 ></Form.Control> 73 <label style={{left: "10px"}}htmlFor="location">Локација:</label>76 <label htmlFor="location">Локација:</label> 74 77 </Form.Floating> 75 78 </Row> … … 81 84 placeholder="Датум на пристигнување:" 82 85 id="dateFrom" 83 value={from}84 86 ></Form.Control> 85 <label style={{left: "10px"}}htmlFor="dateFrom">Датум на пристигнување:</label>87 <label htmlFor="dateFrom">Датум на пристигнување:</label> 86 88 </Form.Floating> 87 89 </Row> … … 93 95 placeholder="Датум на заминување:" 94 96 id="dateTo" 95 value={to}96 97 ></Form.Control> 97 <label style={{left: "10px"}}htmlFor="dateTo">Датум на заминување:</label>98 <label htmlFor="dateTo">Датум на заминување:</label> 98 99 </Form.Floating> 99 100 </Row> … … 106 107 id="floatingPassengers" 107 108 ></Form.Control> 108 <label style={{left: "10px"}}htmlFor="floatingPassengers">Број на гости:</label>109 <label htmlFor="floatingPassengers">Број на гости:</label> 109 110 </Form.Floating> 110 111 </Row> -
frontend/src/Pages/HotelEditPage.js
re6c2521 r5528b99 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 {Navigate, useParams} from "react-router-dom"; 8 import {useAuth} from "../Components/Context/AuthContext"; 7 import { useParams } from "react-router-dom"; 9 8 10 9 11 10 const HotelEditPage = () => { 12 11 13 14 15 16 const {data, setData, isLoading, getData} = useGet(link, changed);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); 17 16 18 17 19 20 21 22 <Navigation/>23 24 25 <h2 style={{color: "#159895", textAlign: "left"}}>Мои ресурси</h2>26 27 28 29 30 31 32 style={{maxWidth: "30%"}}33 34 35 36 37 38 39 40 41 42 43 44 45 <Container className="pt-2" style={{textAlign: "left"}}>46 47 48 49 50 51 52 53 54 55 56 57 58 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 <Col 30 className="d-flex justify-content-center" 31 style={{ maxWidth: "30%" }} 32 > 33 <Image 34 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 ); 59 58 }; 60 59 -
frontend/src/Pages/LoginErrorPage.js
re6c2521 r5528b99 11 11 const [show, setShow] = useState(false); 12 12 const [changed, setChanged] = useState(0); 13 const {data, isLoading} = useGet("/username") 13 14 const userId = localStorage.getItem("userId") 14 15 const [registered, setRegistered] = useState(false); -
frontend/src/Pages/LoginPage.js
re6c2521 r5528b99 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 8 5 9 6 const LoginPage = () => { … … 11 8 document.body.style.marginTop = "auto"; 12 9 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 21 10 return ( 22 11 <> -
frontend/src/Pages/NoBusinessRegisteredError.js
re6c2521 r5528b99 6 6 import RegisterBusinessForm from "../Components/Forms/RegisterBusinessForm"; 7 7 import useGet from "../Components/Hooks/useGet"; 8 import {Navigate, useNavigate} from "react-router-dom"; 9 import {useAuth} from "../Components/Context/AuthContext"; 8 import { useNavigate } from "react-router-dom"; 10 9 11 10 const NoBusinessRegisteredError = (props) => { 12 11 const [show, setShow] = useState(false); 13 12 const [changed, setChanged] = useState(0); 14 const Auth = useAuth(); 15 const isLoggedIn = Auth.userIsAuthenticated(); 13 const {data, isLoading} = useGet("/username") 16 14 const userId = localStorage.getItem("userId") 17 15 const [registered, setRegistered] = useState(false); … … 47 45 48 46 49 if(!isLoggedIn) 50 { 51 return <Navigate to={'/login'}/> 52 } 47 console.log(data) 53 48 49 !isLoading && !data && navigator("/login") 54 50 !firmaIsLoading && firma && firma.length > 0 && firma[0].approved && navigator("/resources/hotel") 55 51 -
frontend/src/Pages/ProfilePage.js
re6c2521 r5528b99 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";12 10 13 11 const ProfilePage = () => { 14 12 15 13 const { data, setData, isLoading, getData } = useGet("/principal"); 16 14 17 18 15 19 16 const profileData = { 20 17 "name": "Марко", … … 22 19 "address": "ул. Раскрсница бр. 10", 23 20 "dateOfBirth": "2002-01-01", 24 "country": " Македонија",21 "country": "Никогаш Северна само МАКЕДОНИЈА", 25 22 "zip": "1000", 26 23 "city": "Скопје", … … 30 27 31 28 32 33 29 return ( 34 30 <> 35 31 <Navigation /> 36 {!isLoading && <Container>32 { !isLoading && <Container> 37 33 <Row className="mb-5"> 38 34 <h2 style={{ color: "#159895", textAlign: "left" }}>Мојот профил</h2> -
frontend/src/Pages/ResourcesPage.js
re6c2521 r5528b99 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";9 7 10 8 const ResourcesPage = (props) => { 11 9 12 const Auth = useAuth();13 const user = Auth.getUser();10 console.log(props.tab) 11 const { data, setData, isLoading, getData } = useGet("/principal"); 14 12 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 ); 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 ); 54 53 }; 55 54 -
frontend/src/Pages/RestaurantEditPage.js
re6c2521 r5528b99 6 6 import RestaurantEditTab from "../Components/RestaurantEdit/RestaurantEditTab"; 7 7 import useGet from "../Components/Hooks/useGet"; 8 import {Navigate, useParams, useSearchParams} from "react-router-dom"; 9 import {useAuth} from "../Components/Context/AuthContext"; 8 import { useParams, useSearchParams } from "react-router-dom"; 10 9 11 10 const RestaurantEditPage = () => { -
frontend/src/Pages/SearchPage.js
re6c2521 r5528b99 11 11 import BecomeAHost from "../Components/BecomeAHost/BecomeAHost" 12 12 import HotelLisitng from "../Components/Listings/HotelListing" 13 import SearchCriterias Hotel from "../Components/SearchCriterias/SearchCriteriasHotel";13 import SearchCriterias from "../Components/SearchCriterias/SearchCriteriasBar"; 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 <<<<<<< HEAD 19 20 import SearchCriteriasBar from "../Components/SearchCriterias/SearchCriteriasBar"; 20 21 import RestaurantDetailsPage from "./RestaurantDetailsPage"; 21 22 import RestaurantListing from "../Components/Listings/RestaurantListing"; 23 ======= 24 >>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl) 22 25 23 26 … … 39 42 } 40 43 44 <<<<<<< HEAD 41 45 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}` : `/restaurant/search?restaurantLocation=${params.restaurantLocation}&date=${params.date}&hourFrom=${params.hourFrom}&hourTo=${params.hourTo}&numPeople=${params.numPeople}` 46 ======= 47 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}` : "" 48 >>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl) 42 49 console.log(link) 43 50 console.log(params.date) … … 47 54 <> 48 55 <Navigation></Navigation> 49 <SearchCriterias Bar type={props.type} criterias={useParams()}></SearchCriteriasBar>56 <SearchCriterias criterias={useParams()}></SearchCriterias> 50 57 <Container className="d-flex justify-content-end gx-5" style={{maxWidth: "60%"}}> 51 58 <Row> -
frontend/src/Pages/TransportEditPage.js
re6c2521 r5528b99 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 {Navigate, useParams} from "react-router-dom"; 10 import {useAuth} from "../Components/Context/AuthContext"; 9 import { useParams } from "react-router-dom"; 11 10 12 11 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); 13 17 14 const params = useParams();18 !isLoading && console.log(data) 15 19 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 ); 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 ); 63 61 }; 64 62
Note:
See TracChangeset
for help on using the changeset viewer.