mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 16:59:41 +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:
@@ -10,7 +10,7 @@ import Toggle from 'react-toggle';
|
||||
import { muteAccount } from 'flavours/glitch/actions/accounts';
|
||||
import { closeModal } from 'flavours/glitch/actions/modal';
|
||||
import { toggleHideNotifications, changeMuteDuration } from 'flavours/glitch/actions/mutes';
|
||||
import Button from 'flavours/glitch/components/button';
|
||||
import { Button } from 'flavours/glitch/components/button';
|
||||
|
||||
const messages = defineMessages({
|
||||
minutes: { id: 'intervals.full.minutes', defaultMessage: '{number, plural, one {# minute} other {# minutes}}' },
|
||||
@@ -63,10 +63,6 @@ class MuteModal extends PureComponent {
|
||||
onChangeMuteDuration: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.button.focus();
|
||||
}
|
||||
|
||||
handleClick = () => {
|
||||
this.props.onClose();
|
||||
this.props.onConfirm(this.props.account, this.props.notifications, this.props.muteDuration);
|
||||
@@ -76,10 +72,6 @@ class MuteModal extends PureComponent {
|
||||
this.props.onClose();
|
||||
};
|
||||
|
||||
setRef = (c) => {
|
||||
this.button = c;
|
||||
};
|
||||
|
||||
toggleNotifications = () => {
|
||||
this.props.onToggleNotifications();
|
||||
};
|
||||
@@ -134,7 +126,7 @@ class MuteModal extends PureComponent {
|
||||
<Button onClick={this.handleCancel} className='mute-modal__cancel-button'>
|
||||
<FormattedMessage id='confirmation_modal.cancel' defaultMessage='Cancel' />
|
||||
</Button>
|
||||
<Button onClick={this.handleClick} ref={this.setRef}>
|
||||
<Button onClick={this.handleClick} autoFocus>
|
||||
<FormattedMessage id='confirmations.mute.confirm' defaultMessage='Mute' />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user