Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,6 +21,7 @@ with gr.Blocks(css="styles.css") as app:
|
|
21 |
|
22 |
# Display all items as a vertical list
|
23 |
with gr.Column(elem_id="food-list"):
|
|
|
24 |
for food_name in FOOD_DATA.keys():
|
25 |
gr.Button(
|
26 |
value=food_name,
|
@@ -29,11 +30,11 @@ with gr.Blocks(css="styles.css") as app:
|
|
29 |
).click(
|
30 |
display_card,
|
31 |
inputs=[gr.Textbox(value=food_name, visible=False)],
|
32 |
-
outputs=
|
33 |
)
|
34 |
|
35 |
-
#
|
36 |
-
popup_area
|
37 |
|
38 |
# Launch the app
|
39 |
app.launch()
|
|
|
21 |
|
22 |
# Display all items as a vertical list
|
23 |
with gr.Column(elem_id="food-list"):
|
24 |
+
popup_area = gr.HTML(visible=False) # Popup card display area
|
25 |
for food_name in FOOD_DATA.keys():
|
26 |
gr.Button(
|
27 |
value=food_name,
|
|
|
30 |
).click(
|
31 |
display_card,
|
32 |
inputs=[gr.Textbox(value=food_name, visible=False)],
|
33 |
+
outputs=popup_area # Reference the Gradio component, not a string
|
34 |
)
|
35 |
|
36 |
+
# Add the popup area to the app
|
37 |
+
popup_area.render()
|
38 |
|
39 |
# Launch the app
|
40 |
app.launch()
|