This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
2016-10-24 18:07:40 +02:00
|
|
|
import { MEDIA_OPEN, MODAL_CLOSE } from '../actions/modal';
|
|
|
|
import Immutable from 'immutable';
|
|
|
|
|
|
|
|
const initialState = Immutable.Map({
|
|
|
|
url: '',
|
|
|
|
open: false
|
|
|
|
});
|
|
|
|
|
|
|
|
export default function modal(state = initialState, action) {
|
|
|
|
switch(action.type) {
|
2017-01-16 13:27:58 +01:00
|
|
|
case MEDIA_OPEN:
|
|
|
|
return state.withMutations(map => {
|
|
|
|
map.set('url', action.url);
|
|
|
|
map.set('open', true);
|
|
|
|
});
|
|
|
|
case MODAL_CLOSE:
|
|
|
|
return state.set('open', false);
|
|
|
|
default:
|
|
|
|
return state;
|
2016-10-24 18:07:40 +02:00
|
|
|
}
|
|
|
|
};
|