diff --git a/src/assets/sounds/ui/Beep.wav b/src/assets/sounds/ui/Beep.wav new file mode 100644 index 0000000..015e1f6 Binary files /dev/null and b/src/assets/sounds/ui/Beep.wav differ diff --git a/src/assets/sounds/ui/Ding.wav b/src/assets/sounds/ui/Ding.wav new file mode 100644 index 0000000..91a65a3 Binary files /dev/null and b/src/assets/sounds/ui/Ding.wav differ diff --git a/src/assets/sounds/ui/Warning.wav b/src/assets/sounds/ui/Warning.wav new file mode 100644 index 0000000..e9b946e Binary files /dev/null and b/src/assets/sounds/ui/Warning.wav differ diff --git a/src/assets/sounds/ui/readClick.wav b/src/assets/sounds/ui/readClick.wav new file mode 100644 index 0000000..3892721 Binary files /dev/null and b/src/assets/sounds/ui/readClick.wav differ diff --git a/src/assets/sounds/ui/shutter.mp3 b/src/assets/sounds/ui/shutter.mp3 new file mode 100644 index 0000000..9729d79 Binary files /dev/null and b/src/assets/sounds/ui/shutter.mp3 differ diff --git a/src/components/SettingForms/Sound/SoundSettingsFields.tsx b/src/components/SettingForms/Sound/SoundSettingsFields.tsx index 3cc4d6f..c138f9a 100644 --- a/src/components/SettingForms/Sound/SoundSettingsFields.tsx +++ b/src/components/SettingForms/Sound/SoundSettingsFields.tsx @@ -12,7 +12,7 @@ const SoundSettingsFields = () => { const hotlists: Hotlist[] = state.hotlists; const soundOptions = state?.soundOptions?.map((soundOption) => ({ - value: soundOption?.name, + value: soundOption?.soundFile, label: soundOption?.name, })); @@ -48,7 +48,7 @@ const SoundSettingsFields = () => { > {soundOptions?.map(({ value, label }) => { return ( - ); @@ -78,14 +78,8 @@ const SoundSettingsFields = () => {
{values?.hotlists?.length > 0 ? ( values?.hotlists?.map((hotlist, index) => ( -
-
-
-
Make
-
{sighting?.make ?? "-"}
-
-
-
Model
-
{sighting?.model ?? "-"}
-
-
-
Colour
-
{sighting?.color ?? "-"}
-
+ {sighting?.make && ( +
+
Make
+
{sighting?.make ?? "-"}
+
+ )} + {sighting?.model || + (!sighting?.model.trim() && ( +
+
Model
+
{sighting?.model ?? "-"}
+
+ ))} + {sighting?.color && ( +
+
Colour
+
{sighting?.color ?? "-"}
+
+ )} +
Time
{sighting?.timeStamp ?? "-"}
@@ -192,7 +200,7 @@ const SightingModal = ({ isSightingModalOpen, handleClose, sighting, onDelete }: onClick={handleAcknowledgeButton} > - Accept + Acknowledge )} {onDelete ? ( diff --git a/src/context/reducers/SoundContextReducer.ts b/src/context/reducers/SoundContextReducer.ts index 6250239..5012c74 100644 --- a/src/context/reducers/SoundContextReducer.ts +++ b/src/context/reducers/SoundContextReducer.ts @@ -5,9 +5,13 @@ export const initialState: SoundState = { NPEDsound: "popup", hotlists: [{ name: "hotlistName", sound: "notification" }], soundOptions: [ - { name: "switch (Default)", soundFile: null }, - { name: "popup", soundFile: null }, - { name: "notification", soundFile: null }, + { name: "Switch (Default)", soundFile: "switch" }, + { name: "Popup", soundFile: "popup" }, + { name: "Notification", soundFile: "notification" }, + { name: "Beep", soundFile: "beep" }, + { name: "Ding", soundFile: "ding" }, + { name: "Shutter", soundFile: "shutter" }, + { name: "Warning (voice)", soundFile: "warning" }, ], }; diff --git a/src/types/types.ts b/src/types/types.ts index 8d35242..f835d0b 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -43,9 +43,7 @@ export type CameraSettingValues = { id: number | string; }; -export type CameraSettingErrorValues = Partial< - Record ->; +export type CameraSettingErrorValues = Partial>; export type BearerTypeFieldType = { format: string; @@ -291,7 +289,7 @@ export type FormValues = { export type SoundUploadValue = { name: string; - soundFile: File | null; + soundFile: string | undefined; }; export type SoundState = { diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 65a4fc8..78c7b30 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -1,6 +1,11 @@ import switchSound from "../assets/sounds/ui/switch.mp3"; import popup from "../assets/sounds/ui/popup_open.mp3"; import notification from "../assets/sounds/ui/notification.mp3"; +import beep from "../assets/sounds/ui/Beep.wav"; +import warning from "../assets/sounds/ui/Warning.wav"; +import ding from "../assets/sounds/ui/Ding.wav"; +import shutter from "../assets/sounds/ui/shutter.mp3"; + import type { HotlistMatches, SightingType } from "../types/types"; export function getSoundFileURL(name: string) { @@ -8,6 +13,10 @@ export function getSoundFileURL(name: string) { switch: switchSound, popup: popup, notification: notification, + beep: beep, + warning: warning, + ding: ding, + shutter: shutter, }; return sounds[name] ?? null; }