Changeset 07f4e8b for frontend/src/Components/UserPanel
- Timestamp:
- 01/24/24 17:42:28 (10 months ago)
- Branches:
- master
- Children:
- 0f5aa27
- Parents:
- 5528b99
- Location:
- frontend/src/Components/UserPanel
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Components/UserPanel/HotelReservationListing.js
r5528b99 r07f4e8b 12 12 import data from "bootstrap/js/src/dom/data"; 13 13 import {AiOutlinePlusCircle} from "react-icons/ai"; 14 import {MdOutlineRateReview} from "react-icons/md"; 14 import { MdCancel } from "react-icons/md"; 15 import { MdOutlineRateReview } from "react-icons/md" 15 16 import useFormData from "../Hooks/useFormData"; 16 17 import useCreate from "../Hooks/useCreate"; … … 26 27 27 28 console.log(props.data) 29 const { createEntity } = useCreate(); 28 30 const dateFormatter = (str) => { 29 31 const inputDate = new Date(str); … … 114 116 <h3>Вкупна цена: <br></br>{props.data.transportRoute.price}$</h3> 115 117 </Col>} 118 {(!props.past) && <Col className="d-flex flex-column justify-content-center align-content-center"> 119 {<Container id={'ocn'} onClick={(e) => { 120 console.log(e.target) 121 if (e.target.id === 'icon') { 122 createEntity(`/restaurant/${props.data.reservationId}/cancel`, props.setChanged, props.setChanged) 123 window.location.href="/reservations" 124 } 125 }}> 126 <h5 id={'icon'}>Откажи<br/>резервација</h5> 127 <div className="d-flex justify-content-center align-content-center"> 128 <MdCancel size={50} color="#159895"/></div> 129 130 </Container>} 131 </Col>} 116 132 {(props.past) && <Col className="d-flex flex-column justify-content-center align-content-center"> 117 133 {!props.data.reviewed && <Container id={'ocn'} onClick={(e) => { … … 132 148 </Row> 133 149 </Container> 134 {props.type === 'hotel' && <HotelReservationModal s how={show} handleClose={handleClose} data={props.data}/>}135 <ReviewModal type={props.type} showReview={showReview} handleCloseReview={handleCloseReview} data={props.data}/>150 {props.type === 'hotel' && <HotelReservationModal setChanged={props.setChanged} show={show} handleClose={handleClose} data={props.data}/>} 151 <ReviewModal setChanged={props.setChanged} type={props.type} showReview={showReview} handleCloseReview={handleCloseReview} data={props.data}/> 136 152 </>) 137 153 } -
frontend/src/Components/UserPanel/HotelReservationModal.js
r5528b99 r07f4e8b 5 5 import {TbToolsKitchen2} from "react-icons/tb"; 6 6 import React from "react"; 7 import useCreate from "../Hooks/useCreate"; 7 8 8 9 const HotelReservationModal = (props) => { 10 11 const {createEntity} = useCreate(); 9 12 10 13 const dateFormatter = (str) => { … … 17 20 hour12: false, 18 21 }; 22 23 console.log(props) 19 24 20 25 return inputDate.toLocaleString('de-DE', options); … … 189 194 Затвори 190 195 </Button> 196 <Button variant="danger" onClick={() => { 197 createEntity(`/hotel/${props.data.reservationId}/cancel`, props.setChanged) 198 props.handleClose() 199 } 200 }> 201 Откажи резервација 202 </Button> 191 203 </Modal.Footer> 192 204 </Modal> -
frontend/src/Components/UserPanel/PastHotelReservations.js
r5528b99 r07f4e8b 10 10 <> 11 11 {!isLoading && data.map((res) => { 12 return (<HotelReservationListing past={true} data={res} type={'hotel'}></HotelReservationListing>)12 return (<HotelReservationListing setChanged={setChanged} past={true} data={res} type={'hotel'}></HotelReservationListing>) 13 13 })} 14 14 {(!isLoading && data.length === 0) && <h3 className={'my-5'}>Нема податоци за одбраните критериуми!</h3>} -
frontend/src/Components/UserPanel/PastRestaurantReservations.js
r5528b99 r07f4e8b 11 11 <> 12 12 {!isLoading && data.map((res) => { 13 return (<HotelReservationListing past={true} data={res} type={'restaurant'}></HotelReservationListing>) 13 console.log(res) 14 return (<HotelReservationListing setChanged={setChanged} past={true} data={res} type={'restaurant'}></HotelReservationListing>) 14 15 })} 15 16 {(!isLoading && data.length === 0) && <h3 className={'my-5'}>Нема податоци за одбраните критериуми!</h3>} -
frontend/src/Components/UserPanel/PastTransportReservations.js
r5528b99 r07f4e8b 10 10 <> 11 11 {!isLoading && data.map((res) => { 12 return (<HotelReservationListing past={true} data={res} type={'transport'}></HotelReservationListing>)12 return (<HotelReservationListing setChanged={setChanged} past={true} data={res} type={'transport'}></HotelReservationListing>) 13 13 })} 14 14 -
frontend/src/Components/UserPanel/ReviewModal.js
r5528b99 r07f4e8b 10 10 description: "", 11 11 } 12 console.log(props) 12 13 13 14 const {createEntity} = useCreate(); … … 80 81 ...formData, 81 82 hotelId: props.data.hotelId, 82 userId: 1 83 userId: 1, 84 reservationId: props.data.reservationId 83 85 } : 84 86 props.type === 'restaurant' ? { 85 ...formData, 86 restaurantId: props.data.restaurantId, 87 userId: 1 88 } : { 87 ...formData, 88 restaurantId: props.data.restaurantId, 89 userId: 1, 90 reservationId: props.data.reservationId 91 } : { 89 92 ...formData, 90 93 transportId: props.data.transportId, 91 userId: 1 94 userId: 1, 95 reservationId: props.data.reservationId 92 96 } 93 createEntity('/review/add', dataToPost)97 createEntity('/review/add', dataToPost, props.setChanged) 94 98 setFormData(dummy) 95 99 props.handleCloseReview()
Note:
See TracChangeset
for help on using the changeset viewer.