1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-27 11:02:16 +01:00
unleash.unleash/frontend/src/store/ui-config/actions.js
ivaosthu c4900262f2 feat: Customisable UI via config
This feature enables overrides of certain UI elements from the API
such as setting a different background color for the header.

This will make it easier to customise the UI in different environemnt.
2019-03-13 08:49:50 +01:00

19 lines
508 B
JavaScript

import api from '../../data/config-api';
import { dispatchAndThrow } from '../util';
export const RECEIVE_CONFIG = 'RECEIVE_CONFIG';
export const ERROR_RECEIVE_CONFIG = 'ERROR_RECEIVE_CONFIG';
export const receiveConfig = json => ({
type: RECEIVE_CONFIG,
value: json,
});
export function fetchUIConfig() {
return dispatch =>
api
.fetchConfig()
.then(json => dispatch(receiveConfig(json)))
.catch(dispatchAndThrow(dispatch, ERROR_RECEIVE_CONFIG));
}