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