Rammohan0504 commited on
Commit
2ed10f1
·
verified ·
1 Parent(s): 51f418f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -44,13 +44,18 @@ with gr.Blocks() as demo:
44
 
45
  with gr.Tabs():
46
  with gr.Tab("Menu"):
47
- category_buttons = gr.ButtonGroup(["ALL", "VEGAN", "HALAL"])
 
 
 
48
  menu_html = gr.HTML(value=display_dishes("ALL"))
49
 
50
  with gr.Tab("Cart"):
51
  gr.HTML("<p>Your cart is empty.</p>")
52
 
53
- category_buttons.change(display_dishes, inputs=[category_buttons], outputs=[menu_html])
 
 
54
 
55
  gr.HTML(f"""
56
  <div id="popup" style="display: none; position: absolute; left: 50%; transform: translateX(-50%);
 
44
 
45
  with gr.Tabs():
46
  with gr.Tab("Menu"):
47
+ with gr.Row():
48
+ btn_all = gr.Button("ALL")
49
+ btn_vegan = gr.Button("VEGAN")
50
+ btn_halal = gr.Button("HALAL")
51
  menu_html = gr.HTML(value=display_dishes("ALL"))
52
 
53
  with gr.Tab("Cart"):
54
  gr.HTML("<p>Your cart is empty.</p>")
55
 
56
+ btn_all.click(lambda: display_dishes("ALL"), outputs=[menu_html])
57
+ btn_vegan.click(lambda: display_dishes("VEGAN"), outputs=[menu_html])
58
+ btn_halal.click(lambda: display_dishes("HALAL"), outputs=[menu_html])
59
 
60
  gr.HTML(f"""
61
  <div id="popup" style="display: none; position: absolute; left: 50%; transform: translateX(-50%);