Spaces:
Sleeping
Sleeping
Update components/popup_card.py
Browse files- components/popup_card.py +3 -5
components/popup_card.py
CHANGED
@@ -4,13 +4,11 @@ def generate_popup_card(name, model_path):
|
|
4 |
"""
|
5 |
Generates a popup card dynamically for the selected menu item.
|
6 |
"""
|
7 |
-
with gr.Blocks(
|
8 |
gr.Markdown(f"### {name}")
|
9 |
gr.ModelViewer(model_path, label="View in 3D")
|
10 |
gr.Textbox(label="Special Instructions", placeholder="Add any requests here...")
|
11 |
-
gr.Slider(
|
12 |
gr.Button("Add to Cart")
|
13 |
-
gr.Button("Close"
|
14 |
-
None, None, popup.update(visible=False) # Close the popup
|
15 |
-
)
|
16 |
return popup
|
|
|
4 |
"""
|
5 |
Generates a popup card dynamically for the selected menu item.
|
6 |
"""
|
7 |
+
with gr.Blocks() as popup:
|
8 |
gr.Markdown(f"### {name}")
|
9 |
gr.ModelViewer(model_path, label="View in 3D")
|
10 |
gr.Textbox(label="Special Instructions", placeholder="Add any requests here...")
|
11 |
+
gr.Slider(1, 10, value=1, label="Quantity")
|
12 |
gr.Button("Add to Cart")
|
13 |
+
gr.Button("Close").click(lambda: popup.update(visible=False)) # Close the popup dynamically
|
|
|
|
|
14 |
return popup
|