mirror of
https://github.com/mastodon/mastodon.git
synced 2025-05-07 20:26:15 +00:00
refactor: ClearColumnButton
This commit is contained in:
parent
a97ee55650
commit
70085dd2ed
|
@ -1,21 +0,0 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import { PureComponent } from 'react';
|
||||
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import DeleteForeverIcon from '@/material-icons/400-24px/delete_forever.svg?react';
|
||||
import { Icon } from 'mastodon/components/icon';
|
||||
|
||||
export default class ClearColumnButton extends PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
onClick: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
render () {
|
||||
return (
|
||||
<button className='text-btn column-header__setting-btn' tabIndex={0} onClick={this.props.onClick}><Icon id='eraser' icon={DeleteForeverIcon} /> <FormattedMessage id='notifications.clear' defaultMessage='Clear notifications' /></button>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
import React, { MouseEventHandler } from 'react';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import DeleteForeverIcon from '@/material-icons/400-24px/delete_forever.svg?react';
|
||||
import { Icon } from 'mastodon/components/icon';
|
||||
|
||||
interface Props {
|
||||
onClick?: MouseEventHandler<HTMLButtonElement>;
|
||||
}
|
||||
|
||||
const ClearColumnButton: React.FC<Props> = ({ onClick }) => {
|
||||
return (
|
||||
<button
|
||||
className='text-btn column-header__setting-btn'
|
||||
tabIndex={0}
|
||||
onClick={onClick}
|
||||
>
|
||||
<Icon id='eraser' icon={DeleteForeverIcon} />{' '}
|
||||
<FormattedMessage
|
||||
id='notifications.clear'
|
||||
defaultMessage='Clear notifications'
|
||||
/>
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
export default ClearColumnButton;
|
Loading…
Reference in New Issue
Block a user