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