Misc CSS and transition fixes

This commit is contained in:
Dane Everitt 2019-07-27 20:23:44 -07:00
parent df5de4be97
commit ecb5384579
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
5 changed files with 24 additions and 13 deletions

View file

@ -4,6 +4,7 @@ import { FlashMessageType } from '@/components/MessageBox';
export interface FlashStore {
items: FlashMessage[];
addFlash: Action<FlashStore, FlashMessage>;
addError: Action<FlashStore, { message: string; key?: string }>;
clearFlashes: Action<FlashStore, string | void>;
}
@ -20,6 +21,9 @@ const flashes: FlashStore = {
addFlash: action((state, payload) => {
state.items.push(payload);
}),
addError: action((state, payload) => {
state.items.push({ type: 'error', title: 'Error', ...payload });
}),
clearFlashes: action((state, payload) => {
state.items = payload ? state.items.filter(flashes => flashes.key !== payload) : [];
}),