Progress
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { injectIntl, defineMessages } from 'react-intl'
|
||||
import Button from './button'
|
||||
import Icon from './icon'
|
||||
import Text from './text'
|
||||
|
||||
const messages = defineMessages({
|
||||
@@ -15,8 +14,6 @@ class LoadMore extends PureComponent {
|
||||
onClick: PropTypes.func,
|
||||
disabled: PropTypes.bool,
|
||||
visible: PropTypes.bool,
|
||||
maxId: PropTypes.string,
|
||||
gap: PropTypes.bool,
|
||||
intl: PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
@@ -24,13 +21,16 @@ class LoadMore extends PureComponent {
|
||||
visible: true,
|
||||
}
|
||||
|
||||
handleClick = () => {
|
||||
const { gap, maxId } = this.props
|
||||
this.props.onClick(gap ? maxId : undefined)
|
||||
handleClick = (e) => {
|
||||
this.props.onClick()
|
||||
}
|
||||
|
||||
render() {
|
||||
const { disabled, visible, gap, intl } = this.props
|
||||
const {
|
||||
disabled,
|
||||
visible,
|
||||
intl,
|
||||
} = this.props
|
||||
|
||||
return (
|
||||
<div className={[_s.default, _s.py10, _s.px10].join(' ')}>
|
||||
@@ -40,22 +40,15 @@ class LoadMore extends PureComponent {
|
||||
backgroundColor='tertiary'
|
||||
color='primary'
|
||||
disabled={disabled || !visible}
|
||||
style={{ visibility: visible ? 'visible' : 'hidden' }}
|
||||
style={{
|
||||
visibility: visible ? 'visible' : 'hidden',
|
||||
}}
|
||||
onClick={this.handleClick}
|
||||
aria-label={intl.formatMessage(messages.load_more)}
|
||||
>
|
||||
{
|
||||
!gap &&
|
||||
<Text color='inherit' align='center'>
|
||||
{intl.formatMessage(messages.load_more)}
|
||||
</Text>
|
||||
}
|
||||
{
|
||||
gap &&
|
||||
<Text align='center'>
|
||||
<Icon id='ellipsis' size='14px' />
|
||||
</Text>
|
||||
}
|
||||
<Text color='inherit' align='center'>
|
||||
{intl.formatMessage(messages.load_more)}
|
||||
</Text>
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user