0.2.11 • Published 3 years ago

@nteract/mythic-notifications v0.2.11

Weekly downloads
2,923
License
BSD-3-Clause
Repository
-
Last release
3 years ago

@nteract/mythic-notifications

This package implements a notification system based on blueprintjs, using the myths framework.

Installation

$ yarn add @nteract/mythic-notifications
$ npm install --save @nteract/mythic-notifications

Usage

Initialize the package by including the notifications package in your store and rendering the <NotificationsRoot/>:

import { notifications, NotificationRoot } from "@nteract/mythic-notifications";
import { makeConfigureStore } from "@nteract/myths";

export const configureStore = makeConfigureStore({
  packages: [notifications],
});

export const App = () =>
    <>
      {/* ... */}
      <NotificationRoot darkTheme={false} />
    </>

Then dispatch actions made by sendNotification.create:

import { sendNotification } from "@nteract/mythic-notifications";

store.dispatch(sendNotification.create({
  title: "Hello World!",
  message: <em>Hi out there!</em>,
  level: "info",
}));

API

import { IconName } from "@blueprintjs/core";

export interface NotificationMessage {
  key?: string;
  icon?: IconName;
  title?: string;
  message: string | JSX.Element;
  level: "error" | "warning" | "info" | "success" | "in-progress";
  action?: {
    icon?: IconName;
    label: string;
    callback: () => void;
  };
}

Support

If you experience an issue while using this package or have a feature request, please file an issue on the issue board and add the pkg:mythic-notifications label.

License

BSD-3-Clause

0.2.11

3 years ago

0.2.10

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.8-alpha.0

3 years ago

0.2.7-alpha.0

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.8-alpha.0

4 years ago

0.1.7-alpha.0

4 years ago

0.1.6

4 years ago

0.1.6-alpha.0

4 years ago

0.1.5-alpha.0

4 years ago

0.1.4-alpha.0

4 years ago

0.1.3-alpha.0

4 years ago

0.1.2-alpha.0

4 years ago

0.1.1-alpha.0

4 years ago