Changeset ac19a0c for frontend/src/Components/Resources
- Timestamp:
- 01/13/24 23:19:50 (10 months ago)
- Branches:
- master
- Children:
- e85a562
- Parents:
- e9b4ba9
- Location:
- frontend/src/Components/Resources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Components/Resources/AddNew.js
re9b4ba9 rac19a0c 56 56 </Modal.Header> 57 57 <Modal.Body> 58 {props.type === "hotel" && <AddHotelForm refresh={props.refresh}/>}59 {props.type === "room" && <AddRoomForm refresh={props.refresh} hotelId={props.Id}/>}60 {props.type === "restaurant" && <AddRestaurantForm edit="false" refresh={props.refresh}/>}61 {props.type === "transport" && <AddTransportForm refresh={props.refresh}/>}58 {props.type === "hotel" && <AddHotelForm closeModal={handleClose} refresh={props.refresh}/>} 59 {props.type === "room" && <AddRoomForm closeModal={handleClose} refresh={props.refresh} hotelId={props.Id}/>} 60 {props.type === "restaurant" && <AddRestaurantForm edit="false" closeModal={handleClose} refresh={props.refresh}/>} 61 {props.type === "transport" && <AddTransportForm closeModal={handleClose} refresh={props.refresh}/>} 62 62 {props.type === "menu" && <AddItemMenuForm Id={props.Id} refresh={props.refresh}/>} 63 63 {props.type === "route" && <AddTripForm transportId={props.transport.transportID} setSize={setSizeXl} refresh={props.refresh}/>} -
frontend/src/Components/Resources/EditModal.js
re9b4ba9 rac19a0c 31 31 </Modal.Header> 32 32 <Modal.Body> 33 {props.type === "hotel" && <AddHotelForm />}33 {props.type === "hotel" && <AddHotelForm refresh={props.refresh}/>} 34 34 {props.type === "room" && <EditRoomForm refresh={props.refresh} room={props.room}/>} 35 35 {props.type === "restaurant" && <AddRestaurantForm edit="false" refresh={props.refresh}/>} -
frontend/src/Components/Resources/ResourceListing.js
re9b4ba9 rac19a0c 6 6 7 7 const ResourceListing = (props) => { 8 9 console.log("props " + props.id)10 11 8 12 9 const type = props.type == "hotel" ? "сместувањето" : props.type == "restaurant" ? "ресторанот" : "превозот"; 13 10 const name = props.type == "hotel" ? props.data.hotelName : props.type == "restaurant" ? props.data.restaurantName : props.data.transportName 14 const id = props.type == "hotel" ? props.data.hotelId : props.type == "restaurant" ? props.data.resturantId : props.data.transportID 15 return(<> 11 const id = props.type == "hotel" ? props.data.hotelId : props.type == "restaurant" ? props.data.restaurantID : props.data.transportID 12 console.log(props.data) 13 return(<> 16 14 <a href={`${props.type}/${id}`} style={{textDecoration: "none", color:"black"}}> 17 15 <Container className="py-3 px-1 my-4" -
frontend/src/Components/Resources/ResourcesTab.js
re9b4ba9 rac19a0c 11 11 function ResourcesTab(props) { 12 12 const [activeTab, setActiveTab] = useState(props.tab); 13 // const [changed, setChanged] = useState(0); 14 const userId = localStorage.getItem("userId"); 13 const userId = JSON.parse(localStorage.getItem("user")).userId; 15 14 const { data, setData, isLoading, getData, setChanged } = useGet(`${props.tab}/user/${userId}`); 16 15 17 16 const handleSelect = (eventKey) => { 18 17 setActiveTab(eventKey); 19 console.log(props.refresh);20 18 props.refresh(eventKey); 21 console.log("refresh" + eventKey);22 19 }; 23 24 !isLoading && console.log(data);25 console.log(props.tab);26 20 27 21 return ( … … 78 72 data.map((hotel) => { 79 73 return ( 80 <Link key={hotel.hotelId} to={"/resources/hotel/" + hotel.hotelId}>74 <Link style={{textDecoration: "none"}} key={hotel.hotelId} to={"/resources/hotel/" + hotel.hotelId}> 81 75 <ResourceListing 82 76 key={hotel.hotelId} … … 93 87 {props.tab == "/restaurant" && !isLoading && data != null && 94 88 data.map((restaurant) => { 95 console.log("mapiranje " + restaurant)96 89 return ( 97 <Link key={restaurant.restaurantId} to={"/resources/restaurant/" + restaurant.restaurantID}>98 90 <ResourceListing 99 key={restaurant.restaurantI d}91 key={restaurant.restaurantID} 100 92 type="restaurant" 101 93 data={restaurant} 102 /> 103 </Link> 104 ); 94 />); 105 95 })} 106 96 <AddNew type="restaurant" refresh={setChanged}/>
Note:
See TracChangeset
for help on using the changeset viewer.