GetStream / react-activity-feed

Stream React Activity Feed Components
https://getstream.io/react-activity-feed/
BSD 3-Clause "New" or "Revised" License
137 stars 83 forks source link

feature: Ability to manually control NotificationDropdown open/closed state #364

Open duckwaffle opened 2 years ago

duckwaffle commented 2 years ago

Problem / Motivation

There doesn't seem to be any mechanism to open/close the NotificationDropdown control without simulating a click event on the parent element in the dom. It would be incredible if it were possible to programmatically open/close the NotificationDropdown control.

Proposed solution

Expose a boolean? property named isOpen or something along those lines, which is monitored by NotificationDropdown to call setOpen at https://github.com/GetStream/react-activity-feed/blob/abc03aaa34dc03b8e8765f95fc8a1254366a4502/src/components/NotificationDropdown.tsx#L45