You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
508 B
22 lines
508 B
8 years ago
|
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;
|
||
|
}
|
||
|
};
|