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