From 8218c3d3c21bfa7c4f3ee4872722b9b1261576fb Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Thu, 7 Sep 2017 19:27:13 +0200 Subject: Add machine mode with title and delete options --- src/reducers/interaction-level.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/reducers/interaction-level.js') diff --git a/src/reducers/interaction-level.js b/src/reducers/interaction-level.js index b6287aac..a3f3de7f 100644 --- a/src/reducers/interaction-level.js +++ b/src/reducers/interaction-level.js @@ -1,6 +1,7 @@ import { GO_DOWN_ONE_INTERACTION_LEVEL, GO_FROM_BUILDING_TO_ROOM, + GO_FROM_RACK_TO_MACHINE, GO_FROM_ROOM_TO_RACK } from "../actions/interaction-level"; @@ -17,6 +18,13 @@ export function interactionLevel(state = {mode: "BUILDING"}, action) { roomId: state.roomId, tileId: action.tileId }; + case GO_FROM_RACK_TO_MACHINE: + return { + mode: "MACHINE", + roomId: state.roomId, + tileId: state.tileId, + position: action.position, + }; case GO_DOWN_ONE_INTERACTION_LEVEL: if (state.mode === "ROOM") { return { @@ -27,6 +35,12 @@ export function interactionLevel(state = {mode: "BUILDING"}, action) { mode: "ROOM", roomId: state.roomId }; + } else if (state.mode === "MACHINE") { + return { + mode: "RACK", + roomId: state.roomId, + tileId: state.tileId + }; } else { return state; } -- cgit v1.2.3