mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 09:18:59 +00:00
efb35b537a
* add prettier and have it format all js code except website: : * trying running prettier check in CI * fix runs on in CI * change CI job name * fix prettier erros and fix CI
30 lines
620 B
JavaScript
30 lines
620 B
JavaScript
import { LOCATION_CHANGE } from "react-router-redux";
|
|
|
|
import { RENDER_FLASH, HIDE_FLASH } from "./actions";
|
|
|
|
export const initialState = {
|
|
alertType: null,
|
|
isVisible: false,
|
|
message: null,
|
|
undoAction: null,
|
|
};
|
|
|
|
export default (state = initialState, { type, payload }) => {
|
|
switch (type) {
|
|
case RENDER_FLASH:
|
|
return {
|
|
alertType: payload.alertType,
|
|
isVisible: true,
|
|
message: payload.message,
|
|
undoAction: payload.undoAction,
|
|
};
|
|
case HIDE_FLASH:
|
|
case LOCATION_CHANGE:
|
|
return {
|
|
...initialState,
|
|
};
|
|
default:
|
|
return state;
|
|
}
|
|
};
|