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