-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added student id insert, fixed guest booking bug, fixed some layouts
- Loading branch information
1 parent
7332818
commit 4b8e74f
Showing
6 changed files
with
256 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import React from 'react'; | ||
import { Image, Modal, Grid, Button } from 'semantic-ui-react'; | ||
import { TextField, FormLabel, FormControlLabel, RadioGroup, Radio } from '@material-ui/core'; | ||
import axios from 'axios'; | ||
import { apiurl } from '../../store/data'; | ||
|
||
export default class AddStudentIDModal extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
studentID: 1, | ||
addButton: 'Add ID' | ||
}; | ||
} | ||
|
||
render() { | ||
return ( | ||
<Modal trigger={this.props.trigger} size="small"> | ||
<Modal.Header> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
justifyContent: 'center' | ||
}} | ||
> | ||
<h3>Add Student ID</h3> | ||
</div> | ||
</Modal.Header> | ||
<Modal.Content> | ||
<Grid columns={1} stretched={true}> | ||
<Grid.Row> | ||
<Grid.Column> | ||
<TextField | ||
label="Student ID" | ||
fullWidth | ||
margin="normal" | ||
onChange={(e) => | ||
this.setState({ | ||
studentID: e.target.value | ||
})} | ||
variant="outlined" | ||
/> | ||
</Grid.Column> | ||
</Grid.Row> | ||
</Grid> | ||
</Modal.Content> | ||
<Modal.Actions> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
justifyContent: 'center' | ||
}} | ||
> | ||
<Button | ||
content={this.state.addButton} | ||
primary | ||
onClick={() => { | ||
axios | ||
.post(apiurl + '/api/addstudentid', { | ||
STUDENT_ID: this.state.studentID | ||
}) | ||
.then((response) => { | ||
this.setState({ | ||
addButton: 'LOADING' | ||
}); | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
this.setState({ | ||
addButton: 'ERROR' | ||
}); | ||
console.log(error); | ||
}); | ||
}} | ||
/> | ||
</div> | ||
</Modal.Actions> | ||
</Modal> | ||
); | ||
} | ||
} |
Oops, something went wrong.