2023-05-28 14:38:10 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2023-05-28 12:18:23 +00:00
|
|
|
import { PureComponent } from 'react';
|
2023-05-28 14:38:10 +00:00
|
|
|
|
2017-01-30 17:04:15 +00:00
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
|
2023-05-28 12:18:23 +00:00
|
|
|
export default class LoadMore extends PureComponent {
|
2017-05-29 15:52:45 +00:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
onClick: PropTypes.func,
|
2018-05-27 17:10:37 +00:00
|
|
|
disabled: PropTypes.bool,
|
2017-07-14 20:31:25 +00:00
|
|
|
visible: PropTypes.bool,
|
2023-02-03 19:52:07 +00:00
|
|
|
};
|
2017-07-14 20:31:25 +00:00
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
visible: true,
|
2023-02-03 19:52:07 +00:00
|
|
|
};
|
2017-05-29 15:52:45 +00:00
|
|
|
|
|
|
|
render() {
|
2018-05-27 17:10:37 +00:00
|
|
|
const { disabled, visible } = this.props;
|
2017-07-14 20:31:25 +00:00
|
|
|
|
2017-05-29 15:52:45 +00:00
|
|
|
return (
|
2018-05-27 17:10:37 +00:00
|
|
|
<button className='load-more' disabled={disabled || !visible} style={{ visibility: visible ? 'visible' : 'hidden' }} onClick={this.props.onClick}>
|
2017-05-29 15:52:45 +00:00
|
|
|
<FormattedMessage id='status.load_more' defaultMessage='Load more' />
|
|
|
|
</button>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|