@thingspro-web/navbar-ui

ThingsPro Navbar UI

Stats

StarsIssuesVersionUpdatedCreatedSize
@thingspro-web/navbar-ui
2.6.13 years ago3 years agoMinified + gzip package size for @thingspro-web/navbar-ui in KB

Readme

sanji-navbar-ui

Notifications

The notification feature allows the system to show some inportant information to users.

How to add / remove a notification to navbar

1. Create a notification with a following format

const notification = {
  // Currently, we only support 'info' tag.
  category: 'info',
  item: {
    // The name MUST be a key for i18n json.
    name: 'NOTIFICATIONS_CHANGE_PASSWORD',
    // The url should be a name of angularJS ui-router.
    url: 'accounts/'
  }
};

2. Use redux to update notification statement

// Notice!!: You should inject $ngRedux and navbarAction before you copy the code below.
$ngRedux.dispatch(this.navbarAction.updateNotifications(nitification));

3. Use redux to remove a specific notification

// Notice!!: You should inject $ngRedux and navbarAction before you copy the code below.
$ngRedux.dispatch(this.navbarAction.removeMotifications(nitification));

4. Show notification icon

// Notice!!: You should inject $ngRedux and navbarAction before you copy the code below.
$ngRedux.dispatch(this.navbarAction.updateNavbarStatus({ config: { isShowNotification: true } }));

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.