-
Notifications
You must be signed in to change notification settings - Fork 148
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
feat: Alerts component #621
Conversation
Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com>
Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com>
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.
Non-blocking comments
|
||
const AlertIcon: React.FC = () => { | ||
return ( | ||
<svg |
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.
Would it make sense to have a common/icons
where we start putting new amundsen icons that use inline-svgs?
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.
Makes sense! I will move it there!
<AlertIcon /> | ||
<p className="alert-message">{message}</p> | ||
{actionText && onAction && ( | ||
<button type="button" className="btn btn-link" onClick={onAction}> |
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.
For our internal use case, the text will end up being a link to another Amundsen page. Given our desire to use the correct components for specific actions, do you think we should still support a button with onClick vs and anchor with an href...or both?
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.
Oh, I see.
I could make it support both easily. I will add an optional actionHref prop, if that has a value, I will render a router Link instead
98cc40e
to
93da3e4
Compare
Supporting an action link Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com>
… Alert Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com>
Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com>
Summary of Changes
Adds the alerts component
Includes tests and a SVG icon for the alert
Documentation
Added Storybook story for the component
CheckList
Make sure you have checked all steps below to ensure a timely review.