mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
check if piece exists in props in wallet details
This commit is contained in:
parent
904793269b
commit
b4c7b864fd
@ -17,7 +17,7 @@ import ApiUrls from '../../../../../constants/api_urls';
|
|||||||
|
|
||||||
import { getLangText } from '../../../../../utils/lang_utils';
|
import { getLangText } from '../../../../../utils/lang_utils';
|
||||||
import { mergeOptions } from '../../../../../utils/general_utils';
|
import { mergeOptions } from '../../../../../utils/general_utils';
|
||||||
|
import AppConstants from '../../../../../constants/application_constants';
|
||||||
|
|
||||||
let WalletPieceContainer = React.createClass({
|
let WalletPieceContainer = React.createClass({
|
||||||
|
|
||||||
@ -30,6 +30,7 @@ let WalletPieceContainer = React.createClass({
|
|||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
if(this.props.piece && this.props.piece.title) {
|
||||||
return (
|
return (
|
||||||
<Piece
|
<Piece
|
||||||
piece={this.props.piece}
|
piece={this.props.piece}
|
||||||
@ -54,12 +55,12 @@ let WalletPieceContainer = React.createClass({
|
|||||||
piece={this.props.piece}
|
piece={this.props.piece}
|
||||||
currentUser={this.props.currentUser}
|
currentUser={this.props.currentUser}
|
||||||
loadPiece={this.loadPiece}
|
loadPiece={this.loadPiece}
|
||||||
submitButtonType={this.props.submitButtonType} />
|
submitButtonType={this.props.submitButtonType}/>
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title={getLangText('Loan History')}
|
title={getLangText('Loan History')}
|
||||||
show={this.props.piece.loan_history && this.props.piece.loan_history.length > 0}>
|
show={this.props.piece.loan_history && this.props.piece.loan_history.length > 0}>
|
||||||
<HistoryIterator
|
<HistoryIterator
|
||||||
history={this.props.piece.loan_history} />
|
history={this.props.piece.loan_history}/>
|
||||||
</CollapsibleParagraph>
|
</CollapsibleParagraph>
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title={getLangText('Notes')}
|
title={getLangText('Notes')}
|
||||||
@ -78,6 +79,14 @@ let WalletPieceContainer = React.createClass({
|
|||||||
{this.props.children}
|
{this.props.children}
|
||||||
</Piece>
|
</Piece>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return (
|
||||||
|
<div className="fullpage-spinner">
|
||||||
|
<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_medium.gif'} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user