This repository has been archived by the owner on Dec 24, 2019. It is now read-only.
Allow action
and onClick
for Stacked Notifications
#62
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Since the Notification Component fires the timer when receive props and verify the (if) condition, it is necessary a `clearTimeout` to avoid not desired behaviour with different timers fired. Add an extra condition to only apply if has same `onDismiss` so don't brake the Notification Stack behaviour.
- Leave the `action` and `onClick` props to be defines by the Notification component - Add references to timer to `clearTimeout` when will unmount
- Use an Object to control the Notifications State - Add a method to handle Remove Notification, invoked from `onDismiss` and `onClick`
@elrumordelaluz I'm busy today and tomorrow, but I'll take a look at this on Friday evening. |
@elrumordelaluz This looks good. Can you rebase so the older commits aren't on the branch? Once you do that I will merge and release! |
Note, this resolves #46. |
I realised that there are duplicated commits in the PR, I'm sorry. Due to my lack of deep knowledge in Git area I'm trying different ways to solve it asap, then will send to you. |
@elrumordelaluz need any further assistance? This is a really useful PR for me, so happy to help if I can. |
Closed because of state problems on my fork. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #46.
Add references to timeouts that allows to clear them before unmount each notification.
So, let available to add
action
andonClick
props inNotification
s Components inside a Stack. #46I tryied to let the example as it is (using
OrderedSet
from Immutable.js) but didn't find a way to reference each generatedNotification
Component inside its ownonClick
prop, so I changed the example with a raw Object, referenced with an unique id based onDate.now()
(with the same advice comment).