Replace ternaries with clean alternative
parent
261fecf8ad
commit
510e5b14cd
|
@ -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 => {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue