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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user