Spaces:
Sleeping
Sleeping
Update components/menu.py
Browse files- components/menu.py +5 -5
components/menu.py
CHANGED
|
@@ -13,12 +13,12 @@ def generate_menu():
|
|
| 13 |
for item in menu_items:
|
| 14 |
with gr.Column():
|
| 15 |
gr.Image(item["image"], label=item["name"])
|
| 16 |
-
button = gr.Button("Add
|
| 17 |
-
#
|
| 18 |
button.click(
|
| 19 |
-
generate_popup_card,
|
| 20 |
-
inputs=[],
|
| 21 |
-
outputs=
|
| 22 |
)
|
| 23 |
|
| 24 |
return menu_row
|
|
|
|
| 13 |
for item in menu_items:
|
| 14 |
with gr.Column():
|
| 15 |
gr.Image(item["image"], label=item["name"])
|
| 16 |
+
button = gr.Button(f"Add {item['name']}")
|
| 17 |
+
# Connect button to generate_popup_card function
|
| 18 |
button.click(
|
| 19 |
+
fn=generate_popup_card,
|
| 20 |
+
inputs=[gr.Textbox(value=item["name"], visible=False), gr.Textbox(value=item["model"], visible=False)],
|
| 21 |
+
outputs=gr.update(visible=True) # Show the popup
|
| 22 |
)
|
| 23 |
|
| 24 |
return menu_row
|