Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,13 +44,18 @@ with gr.Blocks() as demo:
|
|
| 44 |
|
| 45 |
with gr.Tabs():
|
| 46 |
with gr.Tab("Menu"):
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
| 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 |
-
|
|
|
|
|
|
|
| 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%);
|