mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 01:25:17 +01:00
merged all branches
fixed clear errors
This commit is contained in:
parent
c177d382e4
commit
7a18c150c7
@ -3,11 +3,11 @@ import React from 'react';
|
||||
let ButtonSubmitOrClose = React.createClass({
|
||||
render() {
|
||||
if (this.props.submitted){
|
||||
return (
|
||||
<div className="modal-footer">
|
||||
Loading
|
||||
</div>
|
||||
)
|
||||
//return (
|
||||
// <div className="modal-footer">
|
||||
// Loading
|
||||
// </div>
|
||||
//)
|
||||
}
|
||||
return (
|
||||
<div className="modal-footer">
|
||||
|
@ -22,12 +22,16 @@ let ShareForm = React.createClass({
|
||||
}
|
||||
},
|
||||
renderForm() {
|
||||
let message = "Hi,\n" +
|
||||
"\n" +
|
||||
"I am sharing \"" + this.props.edition.title + "\" with you.\n" +
|
||||
"\n" +
|
||||
"Truly yours,\n" +
|
||||
this.props.currentUser.username;
|
||||
let title = this.props.edition.title;
|
||||
let username = this.props.currentUser.username;
|
||||
let message =
|
||||
`Hi,
|
||||
|
||||
I am sharing \" ${title} \" with you.
|
||||
|
||||
Truly yours,
|
||||
${username}`;
|
||||
|
||||
return (
|
||||
<form id="share_modal_content" role="form" key="share_modal_content" onSubmit={this.submit}>
|
||||
<InputText
|
||||
|
@ -10,7 +10,11 @@ let AlertMixin = {
|
||||
}.bind(this)
|
||||
);
|
||||
this.setState({alerts: alerts, retry: this.state.retry + 1});
|
||||
},
|
||||
clearAlerts(){
|
||||
this.setState({alerts: null});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
export default AlertMixin;
|
@ -12,6 +12,9 @@ export const FormMixin = {
|
||||
},
|
||||
submit(e) {
|
||||
e.preventDefault();
|
||||
for (var ref in this.refs){
|
||||
this.refs[ref].clearAlerts();
|
||||
}
|
||||
this.setState({submitted: true});
|
||||
fetch(this.url(), {
|
||||
method: 'post',
|
||||
|
Loading…
Reference in New Issue
Block a user