Add opening images in a modal window

This commit is contained in:
Eugen Rochko
2016-10-24 18:07:40 +02:00
parent f8f40f15da
commit de50eff6ac
12 changed files with 146 additions and 8 deletions

View File

@ -0,0 +1,21 @@
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) {
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;
}
};