mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-01-27 15:22:56 +08:00
add searchNode action
This commit is contained in:
parent
bad6fc836f
commit
2d8dc7e0d1
@ -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,
|
||||
|
@ -7,4 +7,5 @@ export interface StorageConfig {
|
||||
hideEditor: boolean;
|
||||
zoomScale: number;
|
||||
transform: number;
|
||||
searchNode: string;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user