bigbuffet-rw/app/soapbox/actions/snackbar.js

26 lines
387 B
JavaScript
Raw Normal View History

2020-09-21 20:56:15 -07:00
import { ALERT_SHOW } from './alerts';
2020-09-28 16:41:35 -07:00
const show = (severity, message) => ({
2020-09-21 20:56:15 -07:00
type: ALERT_SHOW,
message,
severity,
});
export function info(message) {
2020-09-28 16:41:35 -07:00
return show('info', message);
2020-09-21 20:56:15 -07:00
};
export function success(message) {
2020-09-28 16:41:35 -07:00
return show('success', message);
2020-09-21 20:56:15 -07:00
};
export function error(message) {
2020-09-28 16:41:35 -07:00
return show('error', message);
2020-09-21 20:56:15 -07:00
};
export default {
info,
success,
error,
};