Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -414,7 +414,6 @@ def app():
|
|
| 414 |
inputs=[login_email, login_password],
|
| 415 |
outputs=[login_section, menu_section, login_error],
|
| 416 |
)
|
| 417 |
-
# Signup Button
|
| 418 |
signup_button.click(
|
| 419 |
lambda name, phone, email, password: ("Signup successful! Please login.", gr.update(visible=True), gr.update(visible=False)) if save_user(name, phone, email, password) else ("Email already exists.", gr.update(visible=False), gr.update(visible=True)),
|
| 420 |
inputs=[signup_name, signup_phone, signup_email, signup_password],
|
|
@@ -428,20 +427,23 @@ def app():
|
|
| 428 |
lambda: (gr.update(visible=True), gr.update(visible=False)),
|
| 429 |
outputs=[login_section, signup_section],
|
| 430 |
)
|
| 431 |
-
# Navigate to Cart Page (Both Buttons Use the Same Logic)
|
| 432 |
view_cart_button_top.click(
|
| 433 |
lambda: (gr.update(visible=True), gr.update(visible=False)),
|
| 434 |
outputs=[cart_section, menu_section],
|
|
|
|
| 435 |
)
|
| 436 |
view_cart_button_bottom.click(
|
| 437 |
lambda: (gr.update(visible=True), gr.update(visible=False)),
|
| 438 |
outputs=[cart_section, menu_section],
|
|
|
|
| 439 |
)
|
| 440 |
back_to_menu_button.click(
|
| 441 |
lambda: (gr.update(visible=False), gr.update(visible=True)),
|
| 442 |
outputs=[cart_section, menu_section],
|
| 443 |
)
|
| 444 |
|
|
|
|
|
|
|
| 445 |
return demo
|
| 446 |
|
| 447 |
|
|
|
|
| 414 |
inputs=[login_email, login_password],
|
| 415 |
outputs=[login_section, menu_section, login_error],
|
| 416 |
)
|
|
|
|
| 417 |
signup_button.click(
|
| 418 |
lambda name, phone, email, password: ("Signup successful! Please login.", gr.update(visible=True), gr.update(visible=False)) if save_user(name, phone, email, password) else ("Email already exists.", gr.update(visible=False), gr.update(visible=True)),
|
| 419 |
inputs=[signup_name, signup_phone, signup_email, signup_password],
|
|
|
|
| 427 |
lambda: (gr.update(visible=True), gr.update(visible=False)),
|
| 428 |
outputs=[login_section, signup_section],
|
| 429 |
)
|
|
|
|
| 430 |
view_cart_button_top.click(
|
| 431 |
lambda: (gr.update(visible=True), gr.update(visible=False)),
|
| 432 |
outputs=[cart_section, menu_section],
|
| 433 |
+
_js="scrollToTop()", # Scroll to top on visibility change
|
| 434 |
)
|
| 435 |
view_cart_button_bottom.click(
|
| 436 |
lambda: (gr.update(visible=True), gr.update(visible=False)),
|
| 437 |
outputs=[cart_section, menu_section],
|
| 438 |
+
_js="scrollToTop()", # Scroll to top on visibility change
|
| 439 |
)
|
| 440 |
back_to_menu_button.click(
|
| 441 |
lambda: (gr.update(visible=False), gr.update(visible=True)),
|
| 442 |
outputs=[cart_section, menu_section],
|
| 443 |
)
|
| 444 |
|
| 445 |
+
|
| 446 |
+
|
| 447 |
return demo
|
| 448 |
|
| 449 |
|