nagasurendra commited on
Commit
1b6acdb
·
verified ·
1 Parent(s): 85d89c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -10
app.py CHANGED
@@ -338,19 +338,29 @@ def app():
338
  # Menu Page
339
  with gr.Column(visible=False) as menu_section:
340
  gr.Markdown("### Menu Page (Accessible Only After Login)")
341
-
342
- # Radio button for selecting preference
343
- selected_preference = gr.Radio(
344
- choices=["All", "Vegetarian", "Halal/Non-Veg", "Guilt-Free"],
345
- value="All",
346
- label="Choose a Preference",
347
- )
348
-
349
- # Output area for menu items
350
  menu_output = gr.HTML(value=filter_menu("All"))
 
351
 
352
- # Floating cart display
 
 
353
  cart_output = gr.HTML(value="Your cart is empty.", elem_id="floating-cart")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
  # Final order display
355
  final_order_output = gr.HTML(value="", elem_id="final-order")
356
 
 
338
  # Menu Page
339
  with gr.Column(visible=False) as menu_section:
340
  gr.Markdown("### Menu Page (Accessible Only After Login)")
341
+ selected_preference = gr.Radio(choices=["All", "Vegetarian", "Halal/Non-Veg", "Guilt-Free"],
342
+ value="All", label="Choose a Preference")
 
 
 
 
 
 
 
343
  menu_output = gr.HTML(value=filter_menu("All"))
344
+ cart_button = gr.Button("View Cart") # Add this line
345
 
346
+ # Cart Page
347
+ with gr.Column(visible=False) as cart_section:
348
+ gr.Markdown("### Cart Details")
349
  cart_output = gr.HTML(value="Your cart is empty.", elem_id="floating-cart")
350
+ submit_button = gr.Button("Submit")
351
+ back_button = gr.Button("Back")
352
+
353
+ # Dynamic Navigation
354
+ cart_button.click(lambda: (gr.update(visible=False), gr.update(visible=True)),
355
+ outputs=[menu_section, cart_section])
356
+
357
+ back_button.click(lambda: (gr.update(visible=True), gr.update(visible=False)),
358
+ outputs=[menu_section, cart_section])
359
+
360
+ submit_button.click(None, inputs=[], outputs=[], _js="submitCart")
361
+
362
+
363
+
364
  # Final order display
365
  final_order_output = gr.HTML(value="", elem_id="final-order")
366