mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-16 01:09:55 +00:00
[Glitch] Convert <Button> to Typescript
Port 9d45a444f9 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import { PureComponent } from 'react';
|
||||
|
||||
import { injectIntl, FormattedMessage } from 'react-intl';
|
||||
|
||||
import Button from 'flavours/glitch/components/button';
|
||||
import { Button } from 'flavours/glitch/components/button';
|
||||
|
||||
class ConfirmationModal extends PureComponent {
|
||||
|
||||
@@ -23,10 +23,6 @@ class ConfirmationModal extends PureComponent {
|
||||
closeWhenConfirm: true,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.button.focus();
|
||||
}
|
||||
|
||||
handleClick = () => {
|
||||
if (this.props.closeWhenConfirm) {
|
||||
this.props.onClose();
|
||||
@@ -46,10 +42,6 @@ class ConfirmationModal extends PureComponent {
|
||||
this.props.onClose();
|
||||
};
|
||||
|
||||
setRef = (c) => {
|
||||
this.button = c;
|
||||
};
|
||||
|
||||
setDoNotAskRef = (c) => {
|
||||
this.doNotAskCheckbox = c;
|
||||
};
|
||||
@@ -79,7 +71,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>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user