1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-24 02:16:10 +01:00
onion/js/components/ascribe_forms/form_unconsign_request.js

51 lines
1.5 KiB
JavaScript
Raw Normal View History

'use strict';
2015-05-29 16:53:30 +02:00
import React from 'react';
import ApiUrls from '../../constants/api_urls';
import FormMixin from '../../mixins/form_mixin';
import InputTextArea from './input_textarea';
2015-06-03 10:27:11 +02:00
import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close';
2015-07-03 19:08:56 +02:00
import { getLangText } from '../../utils/lang_utils.js'
2015-05-29 16:53:30 +02:00
let UnConsignRequestForm = React.createClass({
mixins: [FormMixin],
url() {
return ApiUrls.ownership_unconsigns_request;
2015-05-29 16:53:30 +02:00
},
2015-05-29 16:53:30 +02:00
getFormData() {
return {
bitcoin_id: this.props.edition.bitcoin_id,
unconsign_request_message: this.refs.unconsign_request_message.state.value
};
2015-05-29 16:53:30 +02:00
},
2015-05-29 16:53:30 +02:00
renderForm() {
let title = this.props.edition.title;
let username = this.props.currentUser.username;
let message =
2015-07-03 19:08:56 +02:00
`${getLangText('Hi')},
2015-05-29 16:53:30 +02:00
2015-07-03 19:08:56 +02:00
${getLangText('I request you to un-consign')} \" ${title} \".
2015-05-29 16:53:30 +02:00
2015-07-03 19:08:56 +02:00
${getLangText('Truly yours')},
2015-05-29 16:53:30 +02:00
${username}`;
return (
<form id="unconsign_request_modal_content" role="form" onSubmit={this.submit}>
<InputTextArea
ref="unconsign_request_message"
defaultValue={message}
required="" />
<ButtonSubmitOrClose
2015-07-03 19:08:56 +02:00
text={getLangText('UNCONSIGN REQUEST')}
2015-05-29 16:53:30 +02:00
onClose={this.props.onRequestHide}
submitted={this.state.submitted} />
</form>
);
}
});
export default UnConsignRequestForm;