mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-10 11:33:01 +00:00
Add React Admin and modify AdminHandler
This commit is contained in:
22
jsx/src/Store.js
Normal file
22
jsx/src/Store.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { combineReducers } from "redux";
|
||||
|
||||
export const initialState = {
|
||||
user_data: undefined,
|
||||
groups_data: undefined,
|
||||
manage_groups_modal: false,
|
||||
};
|
||||
|
||||
export const reducers = (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case "USER_DATA":
|
||||
return Object.assign({}, state, { user_data: action.value });
|
||||
case "GROUPS_DATA":
|
||||
return Object.assign({}, state, { groups_data: action.value });
|
||||
case "TOGGLE_MANAGE_GROUPS_MODAL":
|
||||
return Object.assign({}, state, {
|
||||
manage_groups_modal: !state.manage_groups_modal,
|
||||
});
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user