1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-11 13:33:46 +01:00
onion/js/components/ascribe_forms/form_share_email.js
vrde 729d27559d WIP: Refactoring forms
Conflicts:
	js/components/ascribe_forms/form.js
	js/components/ascribe_forms/form_contract_agreement.js
	js/components/settings_container.js
2015-09-16 22:04:19 +02:00

65 lines
1.8 KiB
JavaScript

'use strict';
import React from 'react';
import Form from './form';
import Property from './property';
import InputTextAreaToggable from './input_textarea_toggable';
import Button from 'react-bootstrap/lib/Button';
import AppConstants from '../../constants/application_constants';
import { getLangText } from '../../utils/lang_utils.js';
let ShareForm = React.createClass({
propTypes: {
url: React.PropTypes.string,
id: React.PropTypes.object,
message: React.PropTypes.string,
editions: React.PropTypes.array,
currentUser: React.PropTypes.object,
handleSuccess: React.PropTypes.func
},
getFormData(){
return this.props.id;
},
render() {
return (
<Form
ref='form'
url={this.props.url}
getFormData={this.getFormData}
handleSuccess={this.props.handleSuccess}
buttonSubmit={getLangText('share')}>
<Property
name='share_emails'
label={getLangText('Emails')}>
<input
type="text"
placeholder={getLangText('Comma separated emails')}
required/>
</Property>
<Property
name='share_message'
label='Personal Message'
editable={true}>
<InputTextAreaToggable
rows={1}
editable={true}
defaultValue={this.props.message}
placeholder={getLangText('Enter a message...')}
required="required"/>
</Property>
</Form>
);
}
});
export default ShareForm;