-
Notifications
You must be signed in to change notification settings - Fork 1
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
expanded alert component to handle auto hide #14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok.
WIPing this as need a way to pass props to the alert snippet |
c563c9b
to
902b488
Compare
902b488
to
7d06043
Compare
timer() { | ||
if (this.props.timeout && this.props.message) { | ||
notificationTimeout = setTimeout(this.props.hideNotification, this.props.timeout); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to clear the timeout somewhere around here too.
In the case where a notification fires, and then 4 seconds later another one fires, the latter would only be displayed for 1 second.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah good point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also move it outside the condition, to cover even more extreme edge cases where the first notification was se to time out, but the second was not.
src/wrapper/index.jsx
Outdated
@@ -1,9 +1,9 @@ | |||
import React, { Fragment } from 'react'; | |||
import { Alert } from '../'; | |||
import { Notifiction } from '../'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's mildly alarming that this passed CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing it must either be undefined
by default (which is CRAZY) or more likely: rollup sucks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another reason we should get rid of the build - no errors are currently thrown on compile
No description provided.