From 1b7b2eec37d51623ff2e2fca8327ca745e8411fd Mon Sep 17 00:00:00 2001 From: Toba Ojo Date: Tue, 30 Sep 2025 15:32:00 +0100 Subject: [PATCH] Implement sound settings update and integrate sound context in sightings widget --- .../SettingForms/Sound/SoundSettingsFields.tsx | 11 +++++------ src/components/SightingsWidget/SightingWidget.tsx | 11 +++++++++-- src/components/UI/NavigationArrow.tsx | 3 ++- src/context/reducers/SoundContextReducer.ts | 4 ++++ src/hooks/useSightingFeed.ts | 15 +++------------ src/utils/utils.ts | 13 +++++++++++++ 6 files changed, 36 insertions(+), 21 deletions(-) diff --git a/src/components/SettingForms/Sound/SoundSettingsFields.tsx b/src/components/SettingForms/Sound/SoundSettingsFields.tsx index c8a712e..0b5c5d0 100644 --- a/src/components/SettingForms/Sound/SoundSettingsFields.tsx +++ b/src/components/SettingForms/Sound/SoundSettingsFields.tsx @@ -2,6 +2,7 @@ import { Field, FieldArray, Form, Formik } from "formik"; import FormGroup from "../components/FormGroup"; import type { FormValues, Hotlist } from "../../../types/types"; import { useSoundContext } from "../../../context/SoundContext"; +import { toast } from "sonner"; const SoundSettingsFields = () => { const { state, dispatch } = useSoundContext(); @@ -34,6 +35,7 @@ const SoundSettingsFields = () => { const handleSubmit = (values: FormValues) => { dispatch({ type: "UPDATE", payload: values }); + toast.success("Sound settings updated"); }; console.log(state); return ( @@ -70,20 +72,18 @@ const SoundSettingsFields = () => { ))} -

Hotlist Sounds

- ( -
+
{values.hotlists.length > 0 ? ( values.hotlists.map((hotlist, index) => (
)) ) : ( - <>No hotlists yet, Add one +

No hotlists yet, Add one

)}
)} />
-