1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-26 01:32:16 +01:00
onion/js/components/ascribe_forms/form_consign.js

67 lines
2.0 KiB
JavaScript
Raw Normal View History

'use strict';
import React from 'react';
2015-07-14 14:16:51 +02:00
import Form from './form';
import Property from './property';
import InputTextAreaToggable from './input_textarea_toggable';
2015-07-14 14:16:51 +02:00
import { getLangText } from '../../utils/lang_utils.js';
2015-06-02 11:38:18 +02:00
2015-07-14 14:16:51 +02:00
let ConsignForm = React.createClass({
propTypes: {
url: React.PropTypes.string,
id: React.PropTypes.object,
message: React.PropTypes.string,
handleSuccess: React.PropTypes.func
},
getFormData(){
return this.props.id;
},
2015-07-14 14:16:51 +02:00
render() {
return (
2015-07-14 14:16:51 +02:00
<Form
ref='form'
url={this.props.url}
getFormData={this.getFormData}
handleSuccess={this.props.handleSuccess}
buttonSubmit={getLangText('CONSIGN')}
buttonCancel={false}>
2015-07-14 14:16:51 +02:00
<Property
name='consignee'
label={getLangText('Email')}>
<input
type="email"
placeholder={getLangText('Email of the consignee')}
required/>
</Property>
<Property
name='consign_message'
label={getLangText('Personal Message')}
editable={true}>
<InputTextAreaToggable
rows={1}
editable={true}
defaultValue={this.props.message}
placeholder={getLangText('Enter a message...')}
required="required"/>
</Property>
<Property
name='password'
label={getLangText('Password')}>
<input
type="password"
placeholder={getLangText('Enter your password')}
required/>
</Property>
<hr />
</Form>
);
}
});
export default ConsignForm;