2023-05-23 18:52:27 +10:00
|
|
|
import { PureComponent } from 'react';
|
2018-04-11 01:12:10 +10:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { injectIntl, defineMessages } from 'react-intl';
|
2023-05-09 11:11:56 +10:00
|
|
|
import { Icon } from 'mastodon/components/icon';
|
2018-04-11 01:12:10 +10:00
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
load_more: { id: 'status.load_more', defaultMessage: 'Load more' },
|
|
|
|
});
|
|
|
|
|
2023-05-23 18:52:27 +10:00
|
|
|
class LoadGap extends PureComponent {
|
2018-04-11 01:12:10 +10:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
disabled: PropTypes.bool,
|
|
|
|
maxId: PropTypes.string,
|
|
|
|
onClick: PropTypes.func.isRequired,
|
|
|
|
intl: PropTypes.object.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
handleClick = () => {
|
|
|
|
this.props.onClick(this.props.maxId);
|
2023-01-30 11:45:35 +11:00
|
|
|
};
|
2018-04-11 01:12:10 +10:00
|
|
|
|
|
|
|
render () {
|
|
|
|
const { disabled, intl } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<button className='load-more load-gap' disabled={disabled} onClick={this.handleClick} aria-label={intl.formatMessage(messages.load_more)}>
|
2019-02-01 10:14:05 +11:00
|
|
|
<Icon id='ellipsis-h' />
|
2018-04-11 01:12:10 +10:00
|
|
|
</button>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2023-03-24 13:17:53 +11:00
|
|
|
|
|
|
|
export default injectIntl(LoadGap);
|