1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00
onion/js/components/ascribe_buttons/unconsign_request_button.js

50 lines
1.5 KiB
JavaScript
Raw Permalink Normal View History

2015-07-14 17:42:15 +02:00
'use strict';
import React from 'react';
import Button from 'react-bootstrap/lib/Button';
import ModalWrapper from '../ascribe_modal/modal_wrapper';
import UnConsignRequestForm from './../ascribe_forms/form_unconsign_request';
import { getLangText } from '../../utils/lang_utils.js';
2015-08-07 15:08:02 +02:00
import ApiUrls from '../../constants/api_urls';
2015-07-14 17:42:15 +02:00
let UnConsignRequestButton = React.createClass({
propTypes: {
currentUser: React.PropTypes.object.isRequired,
edition: React.PropTypes.object.isRequired,
handleSuccess: React.PropTypes.func
2015-07-14 17:42:15 +02:00
},
render: function () {
const { currentUser, edition, handleSuccess } = this.props;
2015-07-14 17:42:15 +02:00
return (
<ModalWrapper
trigger={
2015-07-14 17:42:15 +02:00
<Button bsStyle="danger" className="btn-delete pull-center" bsSize="small" type="submit">
2016-02-08 14:50:24 +01:00
{getLangText('REQUEST UNCONSIGN')}
2015-07-14 17:42:15 +02:00
</Button>
}
handleSuccess={handleSuccess}
2016-02-08 14:50:24 +01:00
title={getLangText('Request to Un-Consign')}>
2015-07-14 17:42:15 +02:00
<UnConsignRequestForm
2015-08-07 15:08:02 +02:00
url={ApiUrls.ownership_unconsigns_request}
id={{'bitcoin_id': edition.bitcoin_id}}
2015-07-14 17:42:15 +02:00
message={`${getLangText('Hi')},
${getLangText('I request you to un-consign')} \" ${edition.title} \".
2015-07-14 17:42:15 +02:00
${getLangText('Truly yours')},
${currentUser.username}`
} />
2015-07-14 17:42:15 +02:00
</ModalWrapper>
);
}
});
export default UnConsignRequestButton;