Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -270,13 +270,26 @@ def show_menu(section):
|
|
| 270 |
"""
|
| 271 |
return html_output
|
| 272 |
|
| 273 |
-
#
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 281 |
|
| 282 |
demo.launch()
|
|
|
|
| 270 |
"""
|
| 271 |
return html_output
|
| 272 |
|
| 273 |
+
# Function to handle button click
|
| 274 |
+
def confirm_selection():
|
| 275 |
+
return "✅ Thank you! Your selection has been noted."
|
| 276 |
+
|
| 277 |
+
# Gradio Blocks version with button
|
| 278 |
+
with gr.Blocks() as demo:
|
| 279 |
+
gr.Markdown("# 🍜🥢 EAT EAT Cafe & Bistro")
|
| 280 |
+
gr.Markdown("Choose a section to explore dishes with images, descriptions, and prices.")
|
| 281 |
+
|
| 282 |
+
section_dropdown = gr.Dropdown(list(menu.keys()), label="Select a Menu Section")
|
| 283 |
+
menu_output = gr.HTML()
|
| 284 |
+
confirm_msg = gr.Textbox(visible=False)
|
| 285 |
+
|
| 286 |
+
section_dropdown.change(fn=show_menu, inputs=section_dropdown, outputs=menu_output)
|
| 287 |
+
|
| 288 |
+
confirm_button = gr.Button("✅ I have made my selection")
|
| 289 |
+
confirm_button.click(fn=confirm_selection, inputs=None, outputs=confirm_msg)
|
| 290 |
+
confirm_msg.render()
|
| 291 |
+
|
| 292 |
+
# Layout
|
| 293 |
+
menu_output.render()
|
| 294 |
|
| 295 |
demo.launch()
|