mirror of
https://github.com/ascribe/onion.git
synced 2024-06-30 13:41:57 +02:00
prize extra data form detail
This commit is contained in:
parent
d03f98af76
commit
049a5a6fcb
|
@ -71,25 +71,31 @@ let PrizePieceDetails = React.createClass({
|
|||
piece: React.PropTypes.object
|
||||
},
|
||||
render() {
|
||||
if (this.props.piece.prize && this.props.piece.prize.name){
|
||||
if (this.props.piece.prize
|
||||
&& this.props.piece.prize.name
|
||||
&& Object.keys(this.props.piece.extra_data).length !== 0){
|
||||
return (
|
||||
<CollapsibleParagraph
|
||||
title="Prize Details"
|
||||
show={true}
|
||||
defaultExpanded={true}>
|
||||
<Form
|
||||
ref='form'>
|
||||
<Property
|
||||
name='test'
|
||||
label='test'
|
||||
editable={false}>
|
||||
<InputTextAreaToggable
|
||||
rows={1}
|
||||
editable={false}
|
||||
defaultValue='test'/>
|
||||
</Property>
|
||||
<hr />
|
||||
</Form>
|
||||
title="Prize Details"
|
||||
show={true}
|
||||
defaultExpanded={true}>
|
||||
<Form ref='form'>
|
||||
{Object.keys(this.props.piece.extra_data).map((data) => {
|
||||
let label = data.replace('_', ' ');
|
||||
return (
|
||||
<Property
|
||||
name={data}
|
||||
label={label}
|
||||
editable={false}>
|
||||
<InputTextAreaToggable
|
||||
rows={1}
|
||||
editable={false}
|
||||
defaultValue={this.props.piece.extra_data[data]}/>
|
||||
</Property>);
|
||||
}
|
||||
)}
|
||||
<hr />
|
||||
</Form>
|
||||
</CollapsibleParagraph>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user