This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2017-05-02 17:04:16 -07:00
|
|
|
import React from 'react';
|
2017-01-30 09:04:15 -08:00
|
|
|
import { FormattedMessage } from 'react-intl';
|
2017-04-21 11:05:35 -07:00
|
|
|
import PropTypes from 'prop-types';
|
2017-01-30 09:04:15 -08:00
|
|
|
|
2017-06-23 10:36:54 -07:00
|
|
|
export default class LoadMore extends React.PureComponent {
|
2017-05-29 08:52:45 -07:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
onClick: PropTypes.func,
|
2017-07-14 13:31:25 -07:00
|
|
|
visible: PropTypes.bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
visible: true,
|
2017-05-29 08:52:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2017-07-14 13:31:25 -07:00
|
|
|
const { visible } = this.props;
|
|
|
|
|
2017-05-29 08:52:45 -07:00
|
|
|
return (
|
2017-09-15 15:32:43 -07:00
|
|
|
<button className='load-more' disabled={!visible} style={{ visibility: visible ? 'visible' : 'hidden' }} onClick={this.props.onClick}>
|
2017-05-29 08:52:45 -07:00
|
|
|
<FormattedMessage id='status.load_more' defaultMessage='Load more' />
|
|
|
|
</button>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|