diff --git a/app/frontend/components/dashboard.py b/app/frontend/components/dashboard.py index 180c49bd07300aa760e090fe39ce6373910d4735..a2748ab90144694e52ecf99543a64e812fc05d3c 100644 --- a/app/frontend/components/dashboard.py +++ b/app/frontend/components/dashboard.py @@ -127,7 +127,30 @@ def dashboard_frame(parent, switch_func, API_URL, token): height=35, command=perform_search, ) - search_button.pack(side="right", padx=20) + search_button.pack(side="right", padx=(0, 20)) + + # Add refresh button with improved design + def refresh_dashboard(): + """Refresh the dashboard to its initial state""" + # Clear search entry + search_entry.delete(0, "end") + # Reload featured shops and recommendations + fetch_featured_shops() + fetch_recommendations() + + refresh_button = ctk.CTkButton( + search_frame, + text="⟳", # Unicode refresh symbol + fg_color="#3b3b3b", # Dark background + text_color="white", + width=35, + height=35, + corner_radius=20, # Make it circular + hover_color=SHOPPING, # Use shopping color on hover + font=("Helvetica", 20), # Larger font for the icon + command=refresh_dashboard, + ) + refresh_button.pack(side="right", padx=(0, 10)) # Featured Shops Carousel carousel_frame = ctk.CTkFrame(main_content, fg_color=CARD_BG, height=300)