Skip to content
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

[Doc] Convert the Snackbar to the new format #2562

Merged
merged 4 commits into from
Dec 17, 2015
Merged

[Doc] Convert the Snackbar to the new format #2562

merged 4 commits into from
Dec 17, 2015

Conversation

oliviertassinari
Copy link
Member

I think that we should make the Snackbar controlled as the Dialog.
@subjectix Do you when me to do it in this PR?
Fix some point of #2572.

@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation PR: Needs Review labels Dec 16, 2015
@alitaheri
Copy link
Member

@oliviertassinari That would be great 👍 👍 a simple open prop with onClose event with reasons timeout, tap, escape? Or maybe we should discuss this O.o I'm not so sure about my proposal 😅

@@ -208,7 +209,7 @@ export default {
borderColor: rawTheme.palette.borderColor,
},
isRtl: false,
zIndex: rawTheme.zIndex,
zIndex: zIndex,
Copy link
Member Author

Choose a reason for hiding this comment

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

The idea of the rawTheme is to build the muiTheme.
So I think that the zIndex has nothing to do inside the rawTheme, as the isRtl.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah good call, I agree. 👍

@oliviertassinari
Copy link
Member Author

@subjectix @newoga I'm done with this one. Could you review 😬? Thanks

@@ -1,4 +1,5 @@
export default {
snackbar: 900,
Copy link
Member

Choose a reason for hiding this comment

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

I think snack bar should be even higher than popover, don't you think? I'd say 2900, must still be less than toolbar.
Wouldn't you agree?

Copy link
Member Author

Choose a reason for hiding this comment

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

I had no idea about the right value. I'm gonna follow you 👍

@alitaheri
Copy link
Member

Address those and merge as you wish. this is awesome 👍 👍

return {
open: this.props.openOnMount,
open: open,
Copy link
Contributor

Choose a reason for hiding this comment

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

might be able to make open a const or directly assign it to this object like

{
  open: this.props.open || this.props.openOnMount,
}

Copy link
Member

Choose a reason for hiding this comment

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

that won't check explicitly for null, it will coerce it to bool.

maybe:

const {
  open,
  openOnMount,
  message,
  action,
} = this.props;

return {
  action,
  message,
  open: open !== null ? openOnMount : open,
  muiTheme: this.context.muiTheme ? this.context.muiTheme : ThemeManager.getMuiTheme(DefaultRawTheme),
};

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to avoid the edge case where open and openOnMount are both set. I know, that's not common.
At least this open variable will be removed with v0.15

@newoga
Copy link
Contributor

newoga commented Dec 17, 2015

@oliviertassinari I gave it a quick look on github and it looks good to me. I definitely prefer it controlled and I like the new deprecatedProp utility function and that it appears it's tied up with the doc generation. 👍 👍

this._timerId = undefined;
}

componentWillMount() {
Copy link
Member Author

Choose a reason for hiding this comment

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

Oops it's componentWillUnMount here

@alitaheri
Copy link
Member

@oliviertassinari Awesome 👍 👍 feel free to merge this 👍 👍

oliviertassinari added a commit that referenced this pull request Dec 17, 2015
[Doc] Convert the Snackbar to the new format
@oliviertassinari oliviertassinari merged commit 7e942cb into mui:master Dec 17, 2015
@oliviertassinari oliviertassinari deleted the doc-codgen-snackbar branch December 17, 2015 21:01
@oliviertassinari
Copy link
Member Author

Thanks guys 🎉

@alitaheri
Copy link
Member

Awesome 🎉 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants