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