Rammohan0504 commited on
Commit
d7e437c
·
verified ·
1 Parent(s): 654b785

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -22
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import gradio as gr
 
2
 
3
  menu_data = [
4
  {"name": "Veg Burger", "category": "VEGAN",
@@ -170,6 +171,9 @@ def display_dishes(category):
170
  html_content += "</div>"
171
  return html_content
172
 
 
 
 
173
  # Main Gradio App
174
  with gr.Blocks() as demo:
175
  gr.HTML(popup_html) # Add the popup container and overlay
@@ -177,27 +181,33 @@ with gr.Blocks() as demo:
177
 
178
  gr.HTML("<h1 style='text-align: center;'>🍛 Biryani Hub Menu 🍛</h1>")
179
 
180
- # Buttons for filtering categories
181
- with gr.Row():
182
- btn_all = gr.Button("ALL")
183
- btn_vegan = gr.Button("VEGAN")
184
- btn_halal = gr.Button("HALAL")
185
-
186
- # Dish display
187
- dish_display = gr.HTML(value=display_dishes("ALL"))
188
-
189
- # Button click events
190
- btn_all.click(
191
- lambda: gr.update(value=display_dishes("ALL")),
192
- outputs=dish_display
193
- )
194
- btn_vegan.click(
195
- lambda: gr.update(value=display_dishes("VEGAN")),
196
- outputs=dish_display
197
- )
198
- btn_halal.click(
199
- lambda: gr.update(value=display_dishes("HALAL")),
200
- outputs=dish_display
201
- )
 
 
 
 
 
 
202
 
203
  demo.launch()
 
1
  import gradio as gr
2
+ from cart_tab import add_to_cart, display_cart
3
 
4
  menu_data = [
5
  {"name": "Veg Burger", "category": "VEGAN",
 
171
  html_content += "</div>"
172
  return html_content
173
 
174
+
175
+
176
+ # Main Gradio App
177
  # Main Gradio App
178
  with gr.Blocks() as demo:
179
  gr.HTML(popup_html) # Add the popup container and overlay
 
181
 
182
  gr.HTML("<h1 style='text-align: center;'>🍛 Biryani Hub Menu 🍛</h1>")
183
 
184
+ with gr.Tabs():
185
+ with gr.Tab("Menu"):
186
+ with gr.Row():
187
+ btn_all = gr.Button("ALL")
188
+ btn_vegan = gr.Button("VEGAN")
189
+ btn_halal = gr.Button("HALAL")
190
+
191
+ dish_display = gr.HTML(value=display_dishes("ALL"))
192
+
193
+ btn_all.click(
194
+ lambda: gr.update(value=display_dishes("ALL")),
195
+ outputs=dish_display
196
+ )
197
+ btn_vegan.click(
198
+ lambda: gr.update(value=display_dishes("VEGAN")),
199
+ outputs=dish_display
200
+ )
201
+ btn_halal.click(
202
+ lambda: gr.update(value=display_dishes("HALAL")),
203
+ outputs=dish_display
204
+ )
205
+
206
+ with gr.Tab("Cart"):
207
+ cart_display = gr.HTML(value=display_cart())
208
+ gr.Button("Refresh Cart").click(
209
+ lambda: gr.update(value=display_cart()),
210
+ outputs=cart_display
211
+ )
212
 
213
  demo.launch()