WIP: Working on snakbar component for notifications#191
WIP: Working on snakbar component for notifications#191
Conversation
|
@kbardi Is this still WIP or is it ready to review? |
| success: SuccessSVG, | ||
| }; | ||
|
|
||
| class Snackbar extends PureComponent { |
There was a problem hiding this comment.
As suggested in our recent call, can we call it Notification? Happy to discuss this, but my favourite naming scheme for blueprint would be to call every thing precisely what it is – Input, DatePicker, VideoPlayer, Loader etc.
| ...componentPropTypes, | ||
| type: PropTypes.oneOf(['error', 'info', 'success', 'warning']), | ||
| message: PropTypes.string, | ||
| action: PropTypes.string, |
There was a problem hiding this comment.
And as suggested in our recent call, I'd love this component to receive children, even though it makes no sense if we use it with message texts from Redux, but I think it's a good practice to always have components who can have something else as content receive children. (It's okay to have "message" too.)
| } | ||
|
|
||
| .snackbarContent { | ||
| font-size: 0.875rem; |
There was a problem hiding this comment.
I think we're missing the font here …?
| import renderer from 'react-test-renderer'; | ||
| import Snackbar from './snackbar.js'; | ||
|
|
||
| describe('Snackbar', () => { |
There was a problem hiding this comment.
Can we have more tests, one for each type, and one for message and another one for children? :)
rin
left a comment
There was a problem hiding this comment.
So far it's good, see my comments! Couldn't test it in Portal locally because I now have the same error that I had in Rory's PR … (Can't resolve 'indexof' in '/Users/rin/code/AIME/blueprint/lib') Let me know when it's ready to test!
WIP: Please do not merge
Create snackbar component to be used and configured from different projects. Still working on transitions.