anon-real / ErgoAuctionHouse

Decentralized auction on top of ERGO.
https://ergoauctions.org
MIT License
30 stars 18 forks source link

add notification center #32

Closed sepehr2github closed 2 years ago

sepehr2github commented 2 years ago
sepehr2github commented 2 years ago

Let me know if any changes needed.

anon-real commented 2 years ago

Thanks! Please resolve conflicts. Also, how to add a notification?

sepehr2github commented 2 years ago

@anon-real So you can add your new notifications to "data" array in "notification" key (local Storage), example: { data:[{message:'test',link:'https://test.com'}], unread:1 }

Do not forget to increase "unread" value for new notifications

anon-real commented 2 years ago

It shouldn't need a refresh to show the notification badge. Also, one nice addition is to show a sticky message when unread is increased (new notifications are added) that "You have new notifications"

anon-real commented 2 years ago

Also, let's also show the time of the notification. So the new notification json will be sth like: { data:[{message:'test',link:'https://test.com', status: 'error', time: 13438347374}], unread:1 }

anon-real commented 2 years ago

Also, please reverse the list before showing. Latest should be first.

anon-real commented 2 years ago

Also, only show the last "unread" notification. If user wants to see previous notifications, there should be a button for that "load read notifications"

sepehr2github commented 2 years ago

@anon-real maybe we can add new border with new tag :). something like discord new messsage

sepehr2github commented 2 years ago

I will send new pull request with your desired features.

anon-real commented 2 years ago

@anon-real maybe we can add new border with new tag :). something like discord new messsage

That is also fine. However, notifications can grow over time to hundreds. Also, I think it is good to fix the modal height and add scroll instead of it grow with notifications.

anon-real commented 2 years ago

@sepehr2github I've added a 'addNotification' method in helper.js. You don't need to add that.

anon-real commented 2 years ago

@sepehr2github Also, this may help, not sure though: https://stackoverflow.com/questions/26974084/listen-for-changes-with-localstorage-on-the-same-window