-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Settings: use form components in general section #1920
Conversation
In general settings, replace all form tags with their equivalent form components.
type="submit" | ||
|
||
disabled={ this.state.fetchingSettings || this.state.submittingForm }> | ||
? <Button |
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.
In cases with condition ? someThing : null
I like to use &&
and have seen it in common use around Calypso.
{ config.isEnabled( 'manage/option_sync_non_public_post_stati' ) &&
<Button
…
/>
}
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 wonder if a <ConfigurationGate key="manage/option..."><Button ... /> </ConfigurationGate>
would make sense down the road...
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.
Though I guess that would always instantiate the Button, (or children) even if they're not needed. hrm.
Either way, not relevant to this PR really. :)
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.
Neat. i was not aware of <ConfigurationGate>
Thanks for pointing it out.
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.
Neat. i was not aware of
<ConfigurationGate>
Thanks for pointing it out.
It doesn't exist. :) Just saying that maybe it ought to, but I think I talked myself out of it.
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.
It doesn't exist. :)
haha. Now it's a scandal!
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.
ConfigurationGate sounds like a scandal ripped right from the headlines. :)
…-components Settings: use form components in general section
As part of the end-of-year maintenance, I plan to clean up the settings section a bit, a task that has been on my list for too long. see #88
This PR aims to replace all form tags in the general settings section with their equivalent form component.
Here is a before / after image. As you can see, nothing changes in appearance, which is expected.