|
@ -52,8 +52,7 @@ const mapDispatchToProps = { |
|
|
type Props = { |
|
|
type Props = { |
|
|
account: Account, |
|
|
account: Account, |
|
|
accounts: Account[], |
|
|
accounts: Account[], |
|
|
canShowMore: boolean, |
|
|
openModal: (string, Object) => *, |
|
|
openModal: Function, |
|
|
|
|
|
t: T, |
|
|
t: T, |
|
|
withAccount?: boolean, |
|
|
withAccount?: boolean, |
|
|
title?: string, |
|
|
title?: string, |
|
@ -66,10 +65,12 @@ type State = { |
|
|
const initialState = { |
|
|
const initialState = { |
|
|
nbToShow: 20, |
|
|
nbToShow: 20, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const footerPlaceholder = null // TODO figure out with design what we want here
|
|
|
|
|
|
|
|
|
export class OperationsList extends PureComponent<Props, State> { |
|
|
export class OperationsList extends PureComponent<Props, State> { |
|
|
static defaultProps = { |
|
|
static defaultProps = { |
|
|
withAccount: false, |
|
|
withAccount: false, |
|
|
canShowMore: false, |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
state = initialState |
|
|
state = initialState |
|
@ -86,7 +87,7 @@ export class OperationsList extends PureComponent<Props, State> { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
render() { |
|
|
render() { |
|
|
const { account, accounts, canShowMore, t, title, withAccount } = this.props |
|
|
const { account, accounts, t, title, withAccount } = this.props |
|
|
const { nbToShow } = this.state |
|
|
const { nbToShow } = this.state |
|
|
|
|
|
|
|
|
if (!account && !accounts) { |
|
|
if (!account && !accounts) { |
|
@ -130,13 +131,14 @@ export class OperationsList extends PureComponent<Props, State> { |
|
|
</Card> |
|
|
</Card> |
|
|
</Box> |
|
|
</Box> |
|
|
))} |
|
|
))} |
|
|
{canShowMore && |
|
|
{!groupedOperations.completed ? ( |
|
|
!groupedOperations.completed && ( |
|
|
<ShowMore onClick={this.fetchMoreOperations}> |
|
|
<ShowMore onClick={this.fetchMoreOperations}> |
|
|
<span>{t('operationsList:showMore')}</span> |
|
|
<span>{t('operationsList:showMore')}</span> |
|
|
<IconAngleDown size={12} /> |
|
|
<IconAngleDown size={12} /> |
|
|
</ShowMore> |
|
|
</ShowMore> |
|
|
) : ( |
|
|
)} |
|
|
footerPlaceholder |
|
|
|
|
|
)} |
|
|
</Box> |
|
|
</Box> |
|
|
</Defer> |
|
|
</Defer> |
|
|
) |
|
|
) |
|
|