Skip to content

Commit

Permalink
Site Settings: Implemenet advanced settings toggle in AfterTheDeadline
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla committed Feb 9, 2017
1 parent 6e46267 commit 202a41a
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions client/my-sites/site-settings/composing/after-the-deadline.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,22 @@ class AfterTheDeadline extends Component {
fields: PropTypes.object,
};

state = {
advancedOptionsVisible: false,
};

onChangeIgnoredPhrases = ( phrases ) => {
this.props.setFieldValue( 'ignored_phrases', phrases.join( ',' ) );
};

onAdvancedOptionsClick = ( event ) => {
event.preventDefault();

this.setState( {
advancedOptionsVisible: ! this.state.advancedOptionsVisible,
} );
};

renderToggle( name, isDisabled, label ) {
const {
fields,
Expand Down Expand Up @@ -177,10 +189,18 @@ class AfterTheDeadline extends Component {
disabled={ isRequestingSettings || isSavingSettings }
/>

{ this.renderProofreadingSection() }
{ this.renderAutoLanguageDetectionSection() }
{ this.renderEnglishOptionsSection() }
{ this.renderIgnoredPhrasesSection() }
<a href="#" onClick={ this.onAdvancedOptionsClick }>
{ translate( 'Advanced Options' ) }
</a>

{ this.state.advancedOptionsVisible && (
<div>
{ this.renderProofreadingSection() }
{ this.renderAutoLanguageDetectionSection() }
{ this.renderEnglishOptionsSection() }
{ this.renderIgnoredPhrasesSection() }
</div>
) }
</FormFieldset>
);
}
Expand Down

0 comments on commit 202a41a

Please sign in to comment.