Ignore:
Timestamp:
01/24/24 17:42:28 (10 months ago)
Author:
darsov2 <62809499+darsov2@…>
Branches:
master
Children:
0f5aa27
Parents:
5528b99
Message:

prefinal fixes

Location:
frontend/src/Components/RestaurantEdit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/Components/RestaurantEdit/MenuListing.js

    r5528b99 r07f4e8b  
    66import { AiOutlinePlusCircle } from "react-icons/ai"
    77import EditModal from "../Resources/EditModal";
     8import AddImages from "../Resources/AddImages";
    89
    910const MenuListing = (props) => {
     
    1213    console.log(props.data)
    1314    return(<>
    14     <a href="#" onClick={(e) => {e.preventDefault(); props.showModal(props.data);
    15     console.log("kliknav")} } style={{textDecoration: "none", color:"black"}}>
     15    <a href="#" style={{textDecoration: "none", color:"black"}}>
    1616        <Container className="py-3 px-1 my-4"
    1717        style={{
     
    2323            <Row>
    2424                <Col className="d-flex justify-content-center">
    25                     <Image
     25                    <Image onClick={(e) => {
     26                        e.preventDefault();
     27                        props.showModal(props.data);
     28                        console.log("kliknav")
     29                    }}
    2630                    src="https://www.tasteofhome.com/wp-content/uploads/2019/01/medium-rare-steak-shutterstock_706040446.jpg"
    2731                    style={{
     
    3741                    <h6>{props.data.ingredients}</h6>
    3842                </Col>
     43                <Col className="d-flex flex-column justify-content-center align-content-center">
     44                    <AddImages type="menu" Id={props.data.menuId} />
     45                </Col>
    3946               
    4047                <Col className="d-flex flex-column justify-content-center align-content-center">
  • frontend/src/Components/RestaurantEdit/RestaurantEditTab.js

    r5528b99 r07f4e8b  
    1010import TableListing from "./TableListing";
    1111import EditModal from "../Resources/EditModal";
     12import ReservationListing from "../HotelEdit/ReservationListing";
     13import useGet from "../Hooks/useGet";
    1214
    1315function RestaurantEditTab(props) {
     
    3537    setActiveTab(eventKey);
    3638  };
     39
     40  const {
     41    data,
     42    isLoading,
     43    setData,
     44    getData,
     45    setChanged: dhanged
     46  } = useGet(`/restaurant/${props.displayMenu.restaurantID}/reservations/active`)
    3747
    3848  console.log(props.displayMenu.restaurantID)
     
    100110              return <MenuListing key={menu.menuId} data={menu} showModal={showModal}/>
    101111            })}
    102             {activeTab === '/hotel' && <EditModal show={show} handleClose={handleClose} type="menu" menu={modalData}></EditModal>}
     112            {activeTab === '/hotel' && <EditModal show={show} refresh={props.refresh} handleClose={handleClose} type="menu" menu={modalData}></EditModal>}
    103113            <AddNew Id={props.displayMenu.restaurantID} refresh={props.refresh} type="menu"/>
    104114          </Tab.Pane>
    105115          <Tab.Pane eventKey="/masi">
    106116           {props.displayMenu.tables.map((table) => {
    107               return <TableListing key={table.tableId} showModal={showModal} data={table}/>
     117              return <TableListing key={table.tableId} refresh={props.refresh} showModal={showModal} handleClose={handleClose} data={table}/>
    108118            })}
    109119            {activeTab === '/masi' && <EditModal show={show} handleClose={handleClose} refresh={props.refresh} type="table"
     
    112122          </Tab.Pane>
    113123          <Tab.Pane eventKey="/restaurant">
    114             <AddNew type="restaurant"/>
     124            {!isLoading && data.map((res) => {
     125              return (
     126                  <ReservationListing type={'restaurant'} data={res}/>
     127              )
     128            })}
    115129          </Tab.Pane>
    116130          <Tab.Pane eventKey="/transport">
  • frontend/src/Components/RestaurantEdit/TableListing.js

    r5528b99 r07f4e8b  
    4141               
    4242                <Col className="d-flex flex-column justify-content-center align-content-center">
    43                   <AddAvailability type="table" table={props.data}/>
     43                  <AddAvailability type="table" refresh={props.refresh} closeModal={props.handleClose} table={props.data}/>
    4444                </Col>
    4545
Note: See TracChangeset for help on using the changeset viewer.