stream-chat-react
stream-chat-react copied to clipboard
feat: Implement a notification system for the whole application
Motivation
Provide a notification system that would serve as an independent module / service, exposing API for addition and removal of notification messages.
There is a component that renders message notifications called MessageListNotifications
that is tightly coupled to the logic of message list (props hasNewMessages
, isNotAtLatestMessageSet
, ...)
Current state
- context provider of notification API -
ChannelStateProvider
- context consumer hook for accessing the API -
useChannelStateContext
- notification rendering component -
MessageListNotifications
Acceptance Criteria
Introduction of:
- context provider of notification API
- context consumer hook for accessing the API
- notification rendering component
Some requirements:
- The notifications should be rendered at the top of the tree, not deeply as in
MessageList
- The display duration of each message notifications should be configurable:
- be displayed until removed programmatically
- be displayed for a x configurable timeout long period
- be displayed until removed manually by clicking a close button
- Integrators should be able to provide own rendering component => control the visual part of the notifications
- CSS with configurable theme variables should be included