mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-28 05:58:12 +08:00
* UI for HTTP error handing in diffexp route * HTTP error handling for other routes * clean up toasters
25 lines
572 B
JavaScript
25 lines
572 B
JavaScript
import { Position, Toaster, Intent } from "@blueprintjs/core";
|
|
|
|
/** Singleton toaster instance. Create separate instances for different options. */
|
|
|
|
const ErrorToastTopCenter = Toaster.create({
|
|
className: "recipe-toaster",
|
|
position: Position.TOP
|
|
});
|
|
|
|
/*
|
|
A "user" error - eg, bad input
|
|
*/
|
|
export const postUserErrorToast = message =>
|
|
ErrorToastTopCenter.show({ message, intent: Intent.WARNING });
|
|
|
|
/*
|
|
a hard network error
|
|
*/
|
|
export const postNetworkErrorToast = message =>
|
|
ErrorToastTopCenter.show({
|
|
message,
|
|
timeout: 30000,
|
|
intent: Intent.DANGER
|
|
});
|