added sound context, and functionality to select sighting sound
This commit is contained in:
19
src/context/reducers/SoundContextReducer.ts
Normal file
19
src/context/reducers/SoundContextReducer.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { SoundPayload, SoundState } from "../../types/types";
|
||||
|
||||
export const initalState: SoundState = {
|
||||
sightingSound: "switch",
|
||||
NPEDsound: "popup",
|
||||
hotlists: [],
|
||||
};
|
||||
|
||||
export function reducer(state: SoundState, action: SoundPayload) {
|
||||
switch (action.type) {
|
||||
case "UPDATE":
|
||||
return {
|
||||
...state,
|
||||
sightingSound: action.payload.sightingSound,
|
||||
NPEDsound: action.payload.NPEDsound,
|
||||
};
|
||||
}
|
||||
return state;
|
||||
}
|
||||
Reference in New Issue
Block a user