Ignore:
Timestamp:
01/13/24 23:19:50 (9 months ago)
Author:
darsov2 <62809499+darsov2@…>
Branches:
master
Children:
e85a562
Parents:
e9b4ba9
Message:

authContext impl, admin panel impl, search bar fixes, reservations listings impl

Location:
frontend/src/Components/Resources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/Components/Resources/AddNew.js

    re9b4ba9 rac19a0c  
    5656        </Modal.Header>
    5757        <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}/>}
    6262            {props.type === "menu" && <AddItemMenuForm Id={props.Id} refresh={props.refresh}/>}
    6363            {props.type === "route" && <AddTripForm transportId={props.transport.transportID} setSize={setSizeXl} refresh={props.refresh}/>}
  • frontend/src/Components/Resources/EditModal.js

    re9b4ba9 rac19a0c  
    3131        </Modal.Header>
    3232        <Modal.Body>
    33             {props.type === "hotel" && <AddHotelForm/>}
     33            {props.type === "hotel" && <AddHotelForm refresh={props.refresh}/>}
    3434            {props.type === "room" && <EditRoomForm refresh={props.refresh} room={props.room}/>}
    3535            {props.type === "restaurant" && <AddRestaurantForm edit="false" refresh={props.refresh}/>}
  • frontend/src/Components/Resources/ResourceListing.js

    re9b4ba9 rac19a0c  
    66
    77const ResourceListing = (props) => {
    8  
    9     console.log("props " + props.id)
    10  
    118
    129    const type = props.type == "hotel" ? "сместувањето" : props.type == "restaurant" ? "ресторанот" : "превозот";
    1310    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(<>
    1614    <a href={`${props.type}/${id}`} style={{textDecoration: "none", color:"black"}}>
    1715        <Container className="py-3 px-1 my-4"
  • frontend/src/Components/Resources/ResourcesTab.js

    re9b4ba9 rac19a0c  
    1111function ResourcesTab(props) {
    1212  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;
    1514  const { data, setData, isLoading, getData, setChanged } = useGet(`${props.tab}/user/${userId}`);
    1615
    1716  const handleSelect = (eventKey) => {
    1817    setActiveTab(eventKey);
    19     console.log(props.refresh);
    2018    props.refresh(eventKey);
    21     console.log("refresh" + eventKey);
    2219  };
    23 
    24   !isLoading && console.log(data);
    25   console.log(props.tab);
    2620
    2721  return (
     
    7872              data.map((hotel) => {
    7973                return (
    80                   <Link key={hotel.hotelId} to={"/resources/hotel/" + hotel.hotelId}>
     74                  <Link style={{textDecoration: "none"}} key={hotel.hotelId} to={"/resources/hotel/" + hotel.hotelId}>
    8175                    <ResourceListing
    8276                      key={hotel.hotelId}
     
    9387            {props.tab == "/restaurant" && !isLoading && data != null &&
    9488              data.map((restaurant) => {
    95                 console.log("mapiranje " + restaurant)
    9689                return (
    97                   <Link key={restaurant.restaurantId} to={"/resources/restaurant/" + restaurant.restaurantID}>
    9890                    <ResourceListing
    99                       key={restaurant.restaurantId}
     91                      key={restaurant.restaurantID}
    10092                      type="restaurant"
    10193                      data={restaurant}
    102                     />
    103                   </Link>
    104                 );
     94                    />);
    10595              })}
    10696            <AddNew type="restaurant" refresh={setChanged}/>
Note: See TracChangeset for help on using the changeset viewer.