fix: exchange function name of component Try-it-out (#4687)

This commit is contained in:
yshkk
2018-07-04 13:53:21 -04:00
committed by kyle
parent f7001f8011
commit 3f06bb50fb
2 changed files with 4 additions and 4 deletions

View File

@@ -21,8 +21,8 @@ export default class TryItOutButton extends React.Component {
return ( return (
<div className="try-out"> <div className="try-out">
{ {
enabled ? <button className="btn try-out__btn cancel" onClick={ onTryoutClick }>Cancel</button> enabled ? <button className="btn try-out__btn cancel" onClick={ onCancelClick }>Cancel</button>
: <button className="btn try-out__btn" onClick={ onCancelClick }>Try it out </button> : <button className="btn try-out__btn" onClick={ onTryoutClick }>Try it out </button>
} }
</div> </div>
) )

View File

@@ -113,11 +113,11 @@ export default class OperationContainer extends PureComponent {
layoutActions.show(["operations", tag, operationId], !isShown) layoutActions.show(["operations", tag, operationId], !isShown)
} }
onTryoutClick =() => { onCancelClick=() => {
this.setState({tryItOutEnabled: !this.state.tryItOutEnabled}) this.setState({tryItOutEnabled: !this.state.tryItOutEnabled})
} }
onCancelClick =() => { onTryoutClick =() => {
let { specActions, path, method } = this.props let { specActions, path, method } = this.props
this.setState({tryItOutEnabled: !this.state.tryItOutEnabled}) this.setState({tryItOutEnabled: !this.state.tryItOutEnabled})
specActions.clearValidateParams([path, method]) specActions.clearValidateParams([path, method])