Replace ternaries with clean alternative

pull/10616/head
Alex P 2018-06-27 10:54:59 -07:00
parent 261fecf8ad
commit 510e5b14cd
2 changed files with 12 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import React, {Component} from 'react'
import classnames from 'classnames'
import {ErrorHandling} from 'src/shared/decorators/errors'
interface Props {
@ -63,7 +64,8 @@ class OverlayTechnology extends Component<Props, State> {
private get overlayClass(): string {
const {visible} = this.props
return `overlay-tech ${visible ? 'show' : ''}`
return classnames('overlay-tech', {show: visible})
}
private hideChildren = (): void => {

View File

@ -154,7 +154,7 @@ class TemplateVariableEditor extends PureComponent<Props, State> {
/>
<div className="form-group text-center form-group-submit col-xs-12">
<ConfirmButton
text={this.isDeleting ? 'Deleting...' : 'Delete'}
text={this.confirmText}
confirmAction={this.handleDelete}
type="btn-danger"
size="btn-sm"
@ -168,6 +168,14 @@ class TemplateVariableEditor extends PureComponent<Props, State> {
)
}
private get confirmText(): string {
if (this.isDeleting) {
return 'Deleting...'
}
return 'Delete'
}
private get title(): string {
const {isNew} = this.state