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

Site Settings: move primary button to <SectionHeader>. #373

Merged
merged 1 commit into from
Nov 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions assets/stylesheets/sections/_site-settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@

.is-primary {
float: right;

&:first-child {
margin-bottom: 20px;
}
}

.empty-content {
Expand Down
67 changes: 43 additions & 24 deletions client/my-sites/site-settings/form-general.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var React = require( 'react' );
* Internal dependencies
*/
var Card = require( 'components/card' ),
Button = require( 'components/button' ),
formBase = require( './form-base' ),
RelatedContentPreview = require( 'my-sites/site-settings/related-content-preview' ),
LanguageSelector = require( 'components/forms/language-selector' ),
Expand Down Expand Up @@ -397,44 +398,62 @@ module.exports = React.createClass( {

return (
<div>
<SectionHeader label={ this.translate( 'Site Profile' ) } />
<SectionHeader label={ this.translate( 'Site Profile' ) }>
<Button
compact={ true }
onClick={ this.submitForm }
primary={ true }
type="submit"
disabled={ this.state.fetchingSettings || this.state.submittingForm }>
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for the next time maybe you could close the Component in the same TAB where it was opened.

    <Button
        compact={ true }
        onClick={ this.submitForm }
        primary={ true }
        type="submit"
        disabled={ this.state.fetchingSettings || this.state.submittingForm }
    >
        { this.state.submittingForm
            ? this.translate( 'Saving…' )
// ...

{ this.state.submittingForm
? this.translate( 'Saving…' )
: this.translate( 'Save Settings' )
}
</Button>
</SectionHeader>
<Card>
<form onSubmit={ this.submitForm } onChange={ this.markChanged }>
<form onChange={ this.markChanged }>
{ this.siteOptions() }
{ this.languageOptions() }
<button
type="submit"
className="button is-primary"
disabled={ this.state.fetchingSettings || this.state.submittingForm }>
{ this.state.submittingForm ? this.translate( 'Saving…' ) : this.translate( 'Save Settings' ) }
</button>
</form>
</Card>
<SectionHeader label={ this.translate( 'Address and visibility' ) } />
<SectionHeader label={ this.translate( 'Address and visibility' ) }>
<Button
compact={ true }
onClick={ this.submitForm }
primary={ true }
type="submit"
disabled={ this.state.fetchingSettings || this.state.submittingForm }>
{ this.state.submittingForm
? this.translate( 'Saving…' )
: this.translate( 'Save Settings' )
}
</Button>
</SectionHeader>
<Card>
<form onSubmit={ this.submitForm } onChange={ this.markChanged }>
<form onChange={ this.markChanged }>
{ this.blogAddress() }
{ this.visibilityOptions() }
<button
type="submit"
className="button is-primary"
disabled={ this.state.fetchingSettings || this.state.submittingForm }>
{ this.state.submittingForm ? this.translate( 'Saving…' ) : this.translate( 'Save Settings' ) }
</button>
</form>
</Card>
<SectionHeader label={ this.translate( 'Other' ) } />
<SectionHeader label={ this.translate( 'Other' ) }>
<Button
compact={ true }
onClick={ this.submitForm }
primary={ true }
type="submit"
disabled={ this.state.fetchingSettings || this.state.submittingForm }>
{ this.state.submittingForm
? this.translate( 'Saving…' )
: this.translate( 'Save Settings' )
}
</Button>
</SectionHeader>
<Card>
<form onSubmit={ this.submitForm } onChange={ this.markChanged }>
<form onChange={ this.markChanged }>
{ this.jetpackOptions() }
{ this.jetpackDisconnectOption() }
{ this.relatedPostsOptions() }
<button
type="submit"
className="button is-primary"
disabled={ this.state.fetchingSettings || this.state.submittingForm }>
{ this.state.submittingForm ? this.translate( 'Saving…' ) : this.translate( 'Save Settings' ) }
</button>
</form>
</Card>
</div>
Expand Down