Ignore:
Timestamp:
05/02/25 15:06:42 (2 weeks ago)
Author:
Aleksandar Panovski <apano77@…>
Branches:
main
Children:
142c0f8
Parents:
2518b3a
Message:

Fixed bugs and fully developed menu now. Readonly added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • my-react-app/src/App.js

    r2518b3a rc44c5ed  
    1919import ReservationHistory from "./components/ReservationHistory";
    2020import AuthContent from "./components/AuthContent";
     21import MenuList from "./components/MenuList";
     22import ReadOnlyMenuList from "./components/ReadOnlyMenuList";
    2123
    2224const ProtectedRoute = ({ element, isAuthenticated }) => {
     
    326328                        <div key={restaurant.id} className="card mb-3">
    327329                            <div className="card-body">
    328                                 <RestaurantInfo key={restaurant.id} restaurant={restaurant}/>
    329                                 {/*<p>Available time slots</p>*/}
    330                                 <div className="d-flex flex-wrap">
    331                                     {restaurant.tablesList && restaurant.tablesList.length > 0 ? (
     330                                <div className="row">
     331                                    {/* Narrow left column: info and actions */}
     332                                    <div className="col-md-4">
     333                                        <RestaurantInfo key={restaurant.id} restaurant={restaurant}/>
    332334                                        <div className="d-flex flex-wrap">
    333                                             {renderTimeSlots(restaurant.tablesList, restaurant)}
     335                                            {restaurant.tablesList && restaurant.tablesList.length > 0 ? (
     336                                                renderTimeSlots(restaurant.tablesList, restaurant)
     337                                            ) : (
     338                                                <p>No tables available for reservations at this restaurant</p>
     339                                            )}
    334340                                        </div>
    335                                     ) : (
    336                                         <p>No tables available for reservations at this restaurant</p>
    337                                     )}
     341                                        <button
     342                                            className="btn btn-secondary mt-3"
     343                                            onClick={() => handleGoToRestaurant(restaurant.restaurantId)}
     344                                        >
     345                                            Go to Restaurant
     346                                        </button>
     347                                    </div>
     348
     349                                    {/* Wide right column: menu */}
     350                                    <div className="col-md-8">
     351                                        <ReadOnlyMenuList restaurantId={restaurant.restaurantId}/>
     352                                    </div>
    338353                                </div>
    339                                 <button
    340                                     className="btn btn-secondary"
    341                                     onClick={() => handleGoToRestaurant(restaurant.restaurantId)}
    342                                 >
    343                                     Go to Restaurant
    344                                 </button>
    345354                            </div>
    346355                        </div>
    347356                    ))}
    348357                </div>
     358
    349359
    350360                {showCuisineSearch && (
Note: See TracChangeset for help on using the changeset viewer.