Convert <Button>
to Typescript (#27492)
This commit is contained in:
parent
ab0fb81479
commit
9d45a444f9
25 changed files with 86 additions and 118 deletions
|
@ -3,7 +3,7 @@ import { PureComponent } from 'react';
|
|||
|
||||
import { injectIntl, FormattedMessage } from 'react-intl';
|
||||
|
||||
import Button from '../../../components/button';
|
||||
import { Button } from '../../../components/button';
|
||||
|
||||
class ConfirmationModal extends PureComponent {
|
||||
|
||||
|
@ -22,10 +22,6 @@ class ConfirmationModal extends PureComponent {
|
|||
closeWhenConfirm: true,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.button.focus();
|
||||
}
|
||||
|
||||
handleClick = () => {
|
||||
if (this.props.closeWhenConfirm) {
|
||||
this.props.onClose();
|
||||
|
@ -42,10 +38,6 @@ class ConfirmationModal extends PureComponent {
|
|||
this.props.onClose();
|
||||
};
|
||||
|
||||
setRef = (c) => {
|
||||
this.button = c;
|
||||
};
|
||||
|
||||
render () {
|
||||
const { message, confirm, secondary } = this.props;
|
||||
|
||||
|
@ -62,7 +54,7 @@ class ConfirmationModal extends PureComponent {
|
|||
{secondary !== undefined && (
|
||||
<Button text={secondary} onClick={this.handleSecondary} className='confirmation-modal__secondary-button' />
|
||||
)}
|
||||
<Button text={confirm} onClick={this.handleClick} ref={this.setRef} />
|
||||
<Button text={confirm} onClick={this.handleClick} autoFocus />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue