diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-08-25 23:03:05 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:05:44 +0200 |
| commit | 8302923a08728d36746af3560ebc35685c2b9da5 (patch) | |
| tree | 028b0e0db8f7e8e60d9127a522ceea49ec395952 /src/reducers | |
| parent | 8f5e6d1e73f16e3cdd523f961d06e4b4eb5a8cef (diff) | |
Enable going from building to room and back
Diffstat (limited to 'src/reducers')
| -rw-r--r-- | src/reducers/index.js | 2 | ||||
| -rw-r--r-- | src/reducers/interaction-level.js | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/reducers/index.js b/src/reducers/index.js index 287a9762..4ddaaec9 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -1,5 +1,6 @@ import {combineReducers} from "redux"; import {auth} from "./auth"; +import {interactionLevel} from "./interaction-level"; import {modals} from "./modals"; import {objects} from "./objects"; import {authorizationsOfCurrentUser, authVisibilityFilter, currentSimulationId} from "./simulations"; @@ -13,6 +14,7 @@ const rootReducer = combineReducers({ authVisibilityFilter, currentSimulationId, currentDatacenterId, + interactionLevel, }); export default rootReducer; diff --git a/src/reducers/interaction-level.js b/src/reducers/interaction-level.js new file mode 100644 index 00000000..4b0b3641 --- /dev/null +++ b/src/reducers/interaction-level.js @@ -0,0 +1,17 @@ +import {GO_FROM_BUILDING_TO_ROOM, GO_FROM_ROOM_TO_BUILDING} from "../actions/interaction-level"; + +export function interactionLevel(state = {mode: "BUILDING"}, action) { + switch (action.type) { + case GO_FROM_BUILDING_TO_ROOM: + return { + mode: "ROOM", + roomId: action.roomId + }; + case GO_FROM_ROOM_TO_BUILDING: + return { + mode: "BUILDING" + }; + default: + return state; + } +} |
