2018-04-10 17:12:10 +02:00
|
|
|
import PropTypes from 'prop-types';
|
2023-05-23 17:15:17 +02:00
|
|
|
import { PureComponent } from 'react';
|
|
|
|
|
2018-04-10 17:12:10 +02:00
|
|
|
import { injectIntl, defineMessages } from 'react-intl';
|
2023-05-23 17:15:17 +02:00
|
|
|
|
2023-05-09 03:11:56 +02:00
|
|
|
import { Icon } from 'mastodon/components/icon';
|
2018-04-10 17:12:10 +02:00
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
load_more: { id: 'status.load_more', defaultMessage: 'Load more' },
|
|
|
|
});
|
|
|
|
|
2023-05-23 10:52:27 +02:00
|
|
|
class LoadGap extends PureComponent {
|
2018-04-10 17:12:10 +02: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 01:45:35 +01:00
|
|
|
};
|
2018-04-10 17:12:10 +02: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 00:14:05 +01:00
|
|
|
<Icon id='ellipsis-h' />
|
2018-04-10 17:12:10 +02:00
|
|
|
</button>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2023-03-24 03:17:53 +01:00
|
|
|
|
|
|
|
export default injectIntl(LoadGap);
|