bigbuffet-rw/app/soapbox/components/load_more.js

34 lines
714 B
JavaScript
Raw Normal View History

import PropTypes from 'prop-types';
2020-03-27 13:59:38 -07:00
import React from 'react';
import { FormattedMessage } from 'react-intl';
2022-03-21 11:09:01 -07:00
import { Button } from 'soapbox/components/ui';
2020-03-27 13:59:38 -07:00
export default class LoadMore extends React.PureComponent {
static propTypes = {
onClick: PropTypes.func,
disabled: PropTypes.bool,
visible: PropTypes.bool,
}
static defaultProps = {
visible: true,
}
render() {
const { disabled, visible } = this.props;
2022-03-21 11:09:01 -07:00
if (!visible) {
return null;
}
2020-03-27 13:59:38 -07:00
return (
2022-03-21 11:09:01 -07:00
<Button theme='secondary' block disabled={disabled || !visible} onClick={this.props.onClick}>
2020-03-27 13:59:38 -07:00
<FormattedMessage id='status.load_more' defaultMessage='Load more' />
2022-03-21 11:09:01 -07:00
</Button>
2020-03-27 13:59:38 -07:00
);
}
}