Skip to content

WIP: Working on snakbar component for notifications#191

Open
kbardi wants to merge 1 commit intostagingfrom
feature/snackbar
Open

WIP: Working on snakbar component for notifications#191
kbardi wants to merge 1 commit intostagingfrom
feature/snackbar

Conversation

@kbardi
Copy link
Copy Markdown
Contributor

@kbardi kbardi commented Mar 10, 2020

WIP: Please do not merge

Create snackbar component to be used and configured from different projects. Still working on transitions.

@kbardi kbardi changed the title Working on snakbar component for notifications WIP: Working on snakbar component for notifications Mar 10, 2020
@kbardi kbardi self-assigned this Mar 16, 2020
@rin
Copy link
Copy Markdown
Contributor

rin commented Mar 18, 2020

@kbardi Is this still WIP or is it ready to review?

success: SuccessSVG,
};

class Snackbar extends PureComponent {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're missing the font here …?

import renderer from 'react-test-renderer';
import Snackbar from './snackbar.js';

describe('Snackbar', () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have more tests, one for each type, and one for message and another one for children? :)

Copy link
Copy Markdown
Contributor

@rin rin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@camposcristian camposcristian removed their request for review June 18, 2020 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants