fleet/frontend/redux/nodes/notifications/reducer.js
Gabe Hernandez efb35b537a
add prettier and have it format all fleet application code (#625)
* 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
2021-04-12 14:32:25 +01:00

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;
}
};