-
Notifications
You must be signed in to change notification settings - Fork 4k
Show multiple alerts in a stack and allow for custom alert icons. #3209
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
Show multiple alerts in a stack and allow for custom alert icons. #3209
Conversation
src/components/alerts/alert.jsx
Outdated
| 'handleOnCloseAlert' | ||
| ]); | ||
| } | ||
| handleOnCloseAlert () { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
src/components/alerts/alert.jsx
Outdated
| 'handleOnCloseAlert' | ||
| ]); | ||
| } | ||
| handleOnCloseAlert () { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| if (extensionId) { // if it's an extension | ||
| const extension = extensionData.find(ext => ext.extensionId === extensionId); | ||
| if (extension && extension.name) { | ||
| // TODO: is this the right place to assemble this message? |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| }; | ||
|
|
||
| const showAlert = function (message) { | ||
| const showAlert = function (data) { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
|
|
||
| const closeAlert = function () { | ||
| return {type: CLOSE_ALERT}; | ||
| const closeAlert = function (index) { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
…ssage construction to reducer.
…andle index correctly. Removed AlertsComponent and added new AlertComponent.
rschamp
left a comment
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 good to me @evhan55! I have a few comments that could be addressed in the follow-up PR
| <AlertComponent | ||
| iconURL={this.props.iconURL} | ||
| message={this.props.message} | ||
| onCloseAlert={this.handleOnCloseAlert} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| className, | ||
| onCloseAlert | ||
| }) => ( | ||
| <Box |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| /** | ||
| * Function to show an alert with the given input data. | ||
| * | ||
| * @param {object} data - data with the following props: {message, extensionId=null} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
ericrosenbaum
left a comment
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.
👍
Resolves
This is progress towards: #2956.
Proposed Changes
Reason for Changes
To improve on previous alerts that displayed directly on top of each other, and to add further customizability with optional icons.
Notes