Skip to content
Snippets Groups Projects
Commit cb1571ec authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

loading bar

parent 399483ee
No related branches found
No related tags found
No related merge requests found
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Modal, Button, Form, Input, TextArea, Icon, Header, Segment, Divider } from 'semantic-ui-react'; import { Modal, Button, Form, Input, TextArea, Icon, Header, Segment, Divider, Dimmer, Loader } from 'semantic-ui-react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { addSolution, writeSolution, writeSolutionFile, addDocument, clearWrite } from '../../actions/homework'; import { addSolution, writeSolution, writeSolutionFile, addDocument, clearWrite } from '../../actions/homework';
import './Forms.css'; import './Forms.css';
...@@ -25,6 +25,7 @@ class AddSolutionForm extends Component { ...@@ -25,6 +25,7 @@ class AddSolutionForm extends Component {
super(props); super(props);
this.state = { this.state = {
showModal: false, showModal: false,
uploadState: true,
}; };
} }
...@@ -176,18 +177,30 @@ class AddSolutionForm extends Component { ...@@ -176,18 +177,30 @@ class AddSolutionForm extends Component {
inverted inverted
color='green' color='green'
> >
<Icon name='checkmark' /> Beadás <Icon name='checkmark' />
Beadás
{this.state.uploadState?
null
:
<Dimmer active>
<Loader size='massive'/>
</Dimmer>}
</Button> </Button>
} }
text='beadod az új megoldást, ami felülírja az előzőt' text='beadod az új megoldást, ami felülírja az előzőt'
onAccept={() => { onAccept={() => {
this.setState({
uploadState: false
})
this.props.addSolution({ this.props.addSolution({
task, accepted, corrected, note, name, description, file, task, accepted, corrected, note, name, description, file,
}).then( ()=> { }).then( (response)=> {
alert('Sikeres feltöltés!') this.setState({
this.setState({ showModal: false }); uploadState: true,
showModal: false
})
this.props.clearWrite(); this.props.clearWrite();
}, ()=> { }, (response)=> {
alert('Sikertelen feltöltés!') alert('Sikertelen feltöltés!')
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment