summaryrefslogtreecommitdiffstats
path: root/front/odiparpack/app/redux/modules/message.js
blob: e02eb08c28c7586a73e9895cb68b5909b318b8aa (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 { CLOSE_MESSAGE,OPEN_MESSAGE } from 'ba-actions/actionTypes';

const initState = {
    message: '',
    type: '',
    openMessage: false
}

const message = (state = initState, action = {}) => {

    const { type, payload } = action;

    switch (type) {

        case CLOSE_MESSAGE:
            return {...initState}
        case OPEN_MESSAGE:
            return {
                ...state,
                ...payload,
                openMessage: true
            }
        default:
            return state

    }

}

export default message;