summaryrefslogtreecommitdiff
path: root/src/reducers/modals.js
blob: e74b66b90537ffff0d7db3ed9d4215edc1b7ea5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import {combineReducers} from "redux";
import {CLOSE_DELETE_PROFILE_MODAL, OPEN_DELETE_PROFILE_MODAL} from "../actions/profile";
import {CLOSE_NEW_SIMULATION_MODAL, OPEN_NEW_SIMULATION_MODAL} from "../actions/simulations";

function newSimulationModalVisible(state = false, action) {
    switch (action.type) {
        case OPEN_NEW_SIMULATION_MODAL:
            return true;
        case CLOSE_NEW_SIMULATION_MODAL:
            return false;
        default:
            return state;
    }
}

function deleteProfileModalVisible(state = false, action) {
    switch (action.type) {
        case OPEN_DELETE_PROFILE_MODAL:
            return true;
        case CLOSE_DELETE_PROFILE_MODAL:
            return false;
        default:
            return state;
    }
}

export const modals = combineReducers({
    newSimulationModalVisible,
    deleteProfileModalVisible,
});