2015-07-14 22:34:34 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
2015-07-14 23:53:49 +02:00
|
|
|
import ModalWrapper from '../ascribe_modal/modal_wrapper';
|
|
|
|
import PieceSubmitToPrizeForm from '../ascribe_forms/form_submit_to_prize';
|
|
|
|
|
2015-07-14 22:34:34 +02:00
|
|
|
import { getLangText } from '../../utils/lang_utils';
|
|
|
|
|
|
|
|
let SubmitToPrizeButton = React.createClass({
|
|
|
|
propTypes: {
|
2015-07-14 23:53:49 +02:00
|
|
|
className: React.PropTypes.string,
|
|
|
|
handleSuccess: React.PropTypes.func,
|
|
|
|
piece: React.PropTypes.object.isRequired
|
2015-07-14 22:34:34 +02:00
|
|
|
},
|
|
|
|
|
2015-07-14 23:53:49 +02:00
|
|
|
getSubmitButton() {
|
2015-07-14 22:34:34 +02:00
|
|
|
return (
|
|
|
|
<button
|
|
|
|
className={classNames('btn', 'btn-default', 'btn-xs', this.props.className)}>
|
|
|
|
{getLangText('Submit to prize')}
|
2015-07-14 23:53:49 +02:00
|
|
|
</button>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<ModalWrapper
|
|
|
|
button={this.getSubmitButton()}
|
|
|
|
handleSuccess={this.props.handleSuccess}
|
|
|
|
title={getLangText('Submit to prize')}>
|
|
|
|
<PieceSubmitToPrizeForm
|
|
|
|
piece={this.props.piece}
|
|
|
|
handleSuccess={this.props.handleSuccess}/>
|
|
|
|
</ModalWrapper>
|
|
|
|
|
2015-07-14 22:34:34 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default SubmitToPrizeButton;
|