Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add maximum number of notification shown #136

Open
chungchi300 opened this issue Jan 24, 2018 · 2 comments
Open

Add maximum number of notification shown #136

chungchi300 opened this issue Jan 24, 2018 · 2 comments

Comments

@chungchi300
Copy link

chungchi300 commented Jan 24, 2018

It is good to have option that

<NotificationSystem max=3 ref="notificationSystem" />

My current simulation of it is

     if (this._notificationSystem.state.notifications.length > 3) {
        let allUIds = this._notificationSystem.state.notifications.map(
          notification => notification.uid
        );

        let keepUIds = this._notificationSystem.state.notifications
          .slice(3)
          .map(notification => notification.uid);
        _.difference(allUIds, keepUIds).map(uid =>
          this._notificationSystem.removeNotification(uid)
        );
      }


@syndbg
Copy link
Collaborator

syndbg commented Jun 18, 2018

@chungchi300 While this is a good idea, few thing are to be considered.

Setting an upper notification limit is fine.

However if the limit is hit there are few ways to handle this:

  • don't add new notifications,
  • replace least recent notification with new one.

Perhaps we can consider which one is the best approach to support and what are the use cases (yours is one of them).

@evansjohnson
Copy link

I am also looking for something similar although my ideal approach would be to collapse all notifications into a notification carousel container.

If there are arguments against using this pattern I'd be interested in hearing them.

img_2799

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants