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