diff --git a/public/sounds/in.ogg b/public/sounds/in.ogg new file mode 100644 index 0000000..5ec26ff Binary files /dev/null and b/public/sounds/in.ogg differ diff --git a/public/sounds/notification.ogg b/public/sounds/notification.ogg new file mode 100644 index 0000000..f097959 Binary files /dev/null and b/public/sounds/notification.ogg differ diff --git a/public/sounds/out.ogg b/public/sounds/out.ogg new file mode 100644 index 0000000..78d4b72 Binary files /dev/null and b/public/sounds/out.ogg differ diff --git a/src/components/common/AchievementToast.tsx b/src/components/common/AchievementToast.tsx index ccaae5c..546ed5b 100644 --- a/src/components/common/AchievementToast.tsx +++ b/src/components/common/AchievementToast.tsx @@ -1,5 +1,6 @@ import { useEffect } from "react"; import { motion, AnimatePresence } from "framer-motion"; +import { useAudio } from "../../context/LauncherContext"; interface AchievementToastProps { message: string | null; @@ -16,14 +17,24 @@ export function AchievementToast({ title = "Error!", variant = "error", }: AchievementToastProps) { + const { playSfx } = useAudio(); + useEffect(() => { if (message) { + if (variant === "update") { + playSfx("notification.ogg"); + } else { + playSfx("in.ogg"); + } const timer = setTimeout(() => { onClose(); }, 8000); - return () => clearTimeout(timer); + return () => { + clearTimeout(timer); + playSfx("out.ogg"); + }; } - }, [message, onClose]); + }, [message, onClose, variant, playSfx]); const getIcon = () => { if (variant === "update") {