add searchNode action

This commit is contained in:
AykutSarac 2022-04-09 14:22:35 +03:00
parent bad6fc836f
commit 2d8dc7e0d1
2 changed files with 11 additions and 0 deletions

View File

@ -12,6 +12,7 @@ export enum ConfigActionType {
ZOOM_OUT,
CENTER_VIEW,
SET_JSON,
SET_SEARCH_NODE,
}
export type ReducerAction = {
@ -27,6 +28,15 @@ export const useConfigReducer: React.Reducer<AppConfig, ReducerAction> = (
case ConfigActionType.SET_CONFIG:
return { ...state, settings: action.payload };
case ConfigActionType.SET_SEARCH_NODE:
return {
...state,
settings: {
...state.settings,
searchNode: action.payload,
},
};
case ConfigActionType.CENTER_VIEW:
return {
...state,

View File

@ -7,4 +7,5 @@ export interface StorageConfig {
hideEditor: boolean;
zoomScale: number;
transform: number;
searchNode: string;
}