feat: implement beautiful toast notifications with Sonner

- Install sonner package for toast notifications
- Add Toaster component to root layout with dark theme styling
- Replace all alert() calls with toast.success() and toast.error()
- Add descriptive messages for success states
- Toast notifications match the app's dark theme design
This commit is contained in:
Millian Lamiaux
2026-03-17 11:45:29 +01:00
parent 554ad2a352
commit 3d026b68ee
7 changed files with 39 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ import { TagInput } from "@/components/tag-input"
import { ExerciseList, Exercise } from "@/components/exercise-list"
import { MediaUpload } from "@/components/media-upload"
import { moveFilesFromTempToWorkout } from "@/lib/storage"
import { toast } from "sonner"
import type { Database } from "@/lib/supabase"
type Workout = Database["public"]["Tables"]["workouts"]["Row"]
@@ -215,7 +216,7 @@ export default function WorkoutForm({ initialData, mode = "create" }: WorkoutFor
router.push(`/workouts/${result.data.id}`)
} catch (err) {
console.error("Failed to save workout:", err)
alert("Failed to save workout. Please try again.")
toast.error("Failed to save workout. Please try again.")
} finally {
setIsLoading(false)
}