mirror of
https://github.com/mastodon/mastodon.git
synced 2025-05-07 20:26:15 +00:00
refactor: GrantPermissionButton
This commit is contained in:
parent
85e89dfc16
commit
a97ee55650
|
@ -1,20 +0,0 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import { PureComponent } from 'react';
|
||||
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
export default class GrantPermissionButton extends PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
onClick: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
render () {
|
||||
return (
|
||||
<button className='text-btn column-header__permission-btn' tabIndex={0} onClick={this.props.onClick}>
|
||||
<FormattedMessage id='notifications.grant_permission' defaultMessage='Grant permission.' />
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
import { MouseEventHandler } from 'react';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
interface Props {
|
||||
onClick: MouseEventHandler<HTMLButtonElement>;
|
||||
}
|
||||
|
||||
const GrantPermissionButton: React.FC<Props> = ({ onClick }) => {
|
||||
return (
|
||||
<button
|
||||
className='text-btn column-header__permission-btn'
|
||||
tabIndex={0}
|
||||
onClick={onClick}
|
||||
>
|
||||
<FormattedMessage
|
||||
id='notifications.grant_permission'
|
||||
defaultMessage='Grant permission.'
|
||||
/>
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
export default GrantPermissionButton;
|
Loading…
Reference in New Issue
Block a user