SathvikGanta commited on
Commit
1af685e
·
verified ·
1 Parent(s): 67c9708

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -21,6 +21,7 @@ with gr.Blocks(css="styles.css") as app:
21
 
22
  # Display all items as clickable cards
23
  with gr.Row(elem_id="food-list"):
 
24
  for food_name in FOOD_DATA.keys():
25
  with gr.Column():
26
  # Each button is a card for a food item
@@ -28,10 +29,11 @@ with gr.Blocks(css="styles.css") as app:
28
  value=food_name,
29
  elem_id=f"food-{food_name.replace(' ', '-').lower()}",
30
  interactive=True,
31
- ).click(display_card, inputs=[gr.Textbox(value=food_name, visible=False)], outputs="display-area")
32
-
33
- # Display area for the popup card
34
- display_area = gr.HTML(elem_id="display-area")
 
35
 
36
  # Launch the app
37
  app.launch()
 
21
 
22
  # Display all items as clickable cards
23
  with gr.Row(elem_id="food-list"):
24
+ display_area = gr.HTML() # Popup card display area
25
  for food_name in FOOD_DATA.keys():
26
  with gr.Column():
27
  # Each button is a card for a food item
 
29
  value=food_name,
30
  elem_id=f"food-{food_name.replace(' ', '-').lower()}",
31
  interactive=True,
32
+ ).click(
33
+ display_card,
34
+ inputs=[gr.Textbox(value=food_name, visible=False)],
35
+ outputs=display_area
36
+ )
37
 
38
  # Launch the app
39
  app.launch()