2020-06-03 12:47:49 -07:00
|
|
|
import {
|
|
|
|
SOAPBOX_CONFIG_REQUEST_SUCCESS,
|
|
|
|
SOAPBOX_CONFIG_REQUEST_FAIL,
|
|
|
|
} from '../actions/soapbox';
|
2020-04-01 12:38:08 -07:00
|
|
|
import { Map as ImmutableMap, fromJS } from 'immutable';
|
|
|
|
|
2020-06-03 12:20:45 -07:00
|
|
|
const initialState = ImmutableMap();
|
2020-04-01 12:38:08 -07:00
|
|
|
|
2020-06-03 12:47:49 -07:00
|
|
|
const defaultState = ImmutableMap({
|
|
|
|
brandColor: '#0482d8', // Azure
|
|
|
|
});
|
|
|
|
|
2020-04-01 12:38:08 -07:00
|
|
|
export default function soapbox(state = initialState, action) {
|
|
|
|
switch(action.type) {
|
2020-06-03 12:24:53 -07:00
|
|
|
case SOAPBOX_CONFIG_REQUEST_SUCCESS:
|
2020-06-03 12:47:49 -07:00
|
|
|
return defaultState.merge(ImmutableMap(fromJS(action.soapboxConfig)));
|
|
|
|
case SOAPBOX_CONFIG_REQUEST_FAIL:
|
|
|
|
return defaultState;
|
2020-04-01 12:38:08 -07:00
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
};
|