-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
updated docs for date picker to new format #2622
updated docs for date picker to new format #2622
Conversation
d169ebb
to
d8e97ec
Compare
import Toggle from 'material-ui/lib/toggle'; | ||
|
||
|
||
const DatePickerExamples = React.createClass({ |
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.
The name is not consistent with docs/src/app/components/DatePicker/ExampleDatePickers.jsx
Can we call this class DatePickerExampleSimple
and the file ExampleSimple.jsx
?
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.
Can we use the ES6 class syntax too?
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.
@oliviertassinari Is there somewhere else with an example of ES6 class in material-ui?
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.
d8e97ec
to
f85141f
Compare
import Toggle from 'material-ui/lib/toggle'; | ||
|
||
const optionsStyle = { | ||
width: '300px', |
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.
That's better here 👍.
Since it's for documentation, I would say that
width: 300,
is better.
46a59f3
to
4e5161e
Compare
@Zadielerick Could you please break the example down to small examples? Also, move the folders to make a structure like this:
Where Page.jsx is the main component of the DatePicker Page. Then update the @oliviertassinari It's ok to work on other things now. I'll rebase if needed ^_^ |
328f421
to
8cbc85c
Compare
shouldDisableDate: React.PropTypes.func, | ||
|
||
/** | ||
* |
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.
Missing documentation?
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.
@oliviertassinari Yeah, it looks like the prop name changes to disableYearSelector as it is passed down to Calendar. Not sure though, wanted to check with yall before changing this
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.
@oliviertassinari If you follow the prop, it is passed down to date picker dialog. Here it is passed down to calendar, but calendar has no such prop, but it has disableYearSelection which isn't called anywhere else. Thought it might be misnamed.
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.
I see now, thanks for the explaination! 😳
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.
Should I rename?
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.
That's definitely broken. I think that the best thing to do is to use disableYearSelection
and to remove showYearSelector
.
Nice finding 👍.
@oliviertassinari Actually, there seems to be a bug with the toggles on the date picker component. Makes the datepicker become uncloseable, and with my pull request toggles dont do anything... Don't know whether thats good or bad... |
this.setState(state); | ||
} | ||
|
||
_handleChange = (nill, date) => { |
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.
nill
-> event
?
How can I reproduce this? |
}); | ||
} | ||
|
||
_handleToggle = (e, toggled) => { |
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.
I would say that event
is more explicit than e
.
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.
👍
To reproduce the bug:
|
import React from 'react'; | ||
import DatePicker from 'material-ui/lib/date-picker/date-picker'; | ||
|
||
export default class DatePickerExampleSimple extends React.Component { |
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.
DatePickerExampleInline
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.
👍
879b457
to
2fabe32
Compare
} | ||
|
||
_handleToggle = (event, toggled) => { | ||
let state = {}; |
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.
const
or you can write instead 👍
this.setState({
[event.target.name]: toggled,
});
|
||
/** | ||
* Creates a ValueLink with the value of date picker. | ||
*/ | ||
valueLink: React.PropTypes.object, |
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.
@oliviertassinari Should we start deprecating this all over the place?
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.
I was wondering. I don't think that we should do it in this PR.
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.
you beat me to it 😆
@Zadielerick Such fine job 👍 👍 Thanks a lot 😁 @oliviertassinari Lets merge this for now. we should make a big PR deprecating valuLinks |
@alitaheri @oliviertassinari Thanks! And thanks for checking my stuff, learning a lot from yall :) |
/** | ||
* Enables the year selection in the date picker. | ||
*/ | ||
showYearSelector: deprecated(React.PropTypes.element, |
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.
bool?
While you're at it. can that controlled DatePicker be somewhere else (it's own example would be good too) because it's like we have two perfectly related inline pickers and then a dialog picker. it feels inconsistent. Sorry my last one I swear 😁 😁 |
Yeah, I wanted to incorporate the controlled date picker into an existing example or else we have 5 examples. Should I put it in another existing or make a new example for it? |
@Zadielerick I don't think having a lot of examples is a bad thing. In fact I would like a library with a lot of examples, it will surely have something for any of my needs. I'd like to hear @oliviertassinari's thoughts on this one. |
I'm all green 👍 👍 @oliviertassinari merge if you're good too 😁 |
[Docs] Update docs for date picker to new format
Thank you @Zadielerick, This was some hard work 👍 👍 👍 🎉 🎈 |
:) No problem! |
@Zadielerick Thanks 😄! |
@oliviertassinari I see, thank you! |
Need feedback. Description for value and value Link. ShowYearSelector seems to be misnamed from disableYearSelection that is passed down to Calendar. Thoughts? Also on the description of the Date Picker.