- implement camera zoom controls and state management
This commit is contained in:
@@ -37,6 +37,11 @@ export const initialState: CameraFeedState = {
|
||||
B: "painter",
|
||||
C: "painter",
|
||||
},
|
||||
zoomLevel: {
|
||||
A: 1,
|
||||
B: 1,
|
||||
C: 1,
|
||||
},
|
||||
};
|
||||
|
||||
export function reducer(state: CameraFeedState, action: CameraFeedAction) {
|
||||
@@ -106,7 +111,14 @@ export function reducer(state: CameraFeedState, action: CameraFeedAction) {
|
||||
return {
|
||||
...initialState,
|
||||
};
|
||||
|
||||
case "SET_ZOOM_LEVEL":
|
||||
return {
|
||||
...state,
|
||||
zoomLevel: {
|
||||
...state.zoomLevel,
|
||||
[action.payload.cameraFeedID]: action.payload.zoomLevel,
|
||||
},
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user