Add CameraSettings context and provider; integrate into AppProviders and VideoFeed
This commit is contained in:
17
src/app/reducers/cameraSettingsReducer.ts
Normal file
17
src/app/reducers/cameraSettingsReducer.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { CameraSettings, CameraSettingsAction } from "../../utils/types";
|
||||
|
||||
export const initialState: CameraSettings = {
|
||||
mode: 0,
|
||||
};
|
||||
|
||||
export const cameraSettingsReducer = (state: CameraSettings, action: CameraSettingsAction) => {
|
||||
switch (action.type) {
|
||||
case "SET_MODE":
|
||||
return {
|
||||
...state,
|
||||
mode: action.payload,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user