mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-03-05 15:00:14 +00:00
added loader image to invite form, fixes #11
This commit is contained in:
BIN
src/assets/images/ajax-loader.gif
Normal file
BIN
src/assets/images/ajax-loader.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
@@ -9,6 +9,7 @@ module.exports = React.createClass({
|
|||||||
return {
|
return {
|
||||||
email: '',
|
email: '',
|
||||||
submitted: false,
|
submitted: false,
|
||||||
|
sending: false,
|
||||||
error: null
|
error: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -17,6 +18,7 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
submitted: false,
|
submitted: false,
|
||||||
|
sending: true,
|
||||||
error: null
|
error: null
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -27,10 +29,10 @@ module.exports = React.createClass({
|
|||||||
.catch(this.handleError);
|
.catch(this.handleError);
|
||||||
},
|
},
|
||||||
handleSuccess() {
|
handleSuccess() {
|
||||||
this.setState({submitted: true});
|
this.setState({submitted: true, sending: false});
|
||||||
},
|
},
|
||||||
handleError(err) {
|
handleError(err) {
|
||||||
this.setState({error: err});
|
this.setState({error: err, sending: false});
|
||||||
},
|
},
|
||||||
onChange(e) {
|
onChange(e) {
|
||||||
if(e.target.value === this.state.email) {
|
if(e.target.value === this.state.email) {
|
||||||
@@ -46,7 +48,8 @@ module.exports = React.createClass({
|
|||||||
var formClasses = classSet({
|
var formClasses = classSet({
|
||||||
'invite-form': true,
|
'invite-form': true,
|
||||||
'has-success': this.state.submitted,
|
'has-success': this.state.submitted,
|
||||||
'has-error': this.state.error
|
'has-error': this.state.error,
|
||||||
|
'sending': this.state.sending
|
||||||
});
|
});
|
||||||
|
|
||||||
var inputClasses = classSet({
|
var inputClasses = classSet({
|
||||||
@@ -91,6 +94,9 @@ module.exports = React.createClass({
|
|||||||
disabled={this.state.error || this.state.submitted}>
|
disabled={this.state.error || this.state.submitted}>
|
||||||
⏎
|
⏎
|
||||||
</button>
|
</button>
|
||||||
|
<span
|
||||||
|
className='loader'>
|
||||||
|
</span>
|
||||||
{feedbackMessage}
|
{feedbackMessage}
|
||||||
</form>
|
</form>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -116,6 +116,20 @@ section:first-child
|
|||||||
color rgba(255, 255, 255, 0.5)
|
color rgba(255, 255, 255, 0.5)
|
||||||
&:active
|
&:active
|
||||||
border-bottom 0
|
border-bottom 0
|
||||||
|
.loader
|
||||||
|
position absolute
|
||||||
|
right 9px
|
||||||
|
top 9px
|
||||||
|
width 0px
|
||||||
|
height 0px
|
||||||
|
background transparent url('../images/ajax-loader.gif') no-repeat center center
|
||||||
|
display block
|
||||||
|
&.sending
|
||||||
|
.btn
|
||||||
|
display none
|
||||||
|
.loader
|
||||||
|
width 28px
|
||||||
|
height 28px
|
||||||
|
|
||||||
@keyframes drop
|
@keyframes drop
|
||||||
0%
|
0%
|
||||||
|
|||||||
Reference in New Issue
Block a user