Circular progress when the editProfile page is loading

This commit is contained in:
Clayton Wilson 2019-12-03 16:26:54 -05:00
parent 825c126c6c
commit a4cce0b75e

View File

@ -56,6 +56,7 @@ export class editProfile extends Component {
// Sets the default values of all the textboxes to the data
// that is stored in the database for the user.
componentDidMount() {
this.setState({pageLoading: true})
axios
.get("/getProfileInfo")
.then((res) => {
@ -64,7 +65,8 @@ export class editProfile extends Component {
lastName: res.data.lastName,
email: res.data.email,
handle: res.data.handle,
bio: res.data.bio
bio: res.data.bio,
pageLoading: false
});
})
.catch((err) => {
@ -89,6 +91,7 @@ export class editProfile extends Component {
bio: "",
anchorEl: null,
loading: false,
pageLoading: false,
errors: {}
};
}
@ -171,6 +174,9 @@ export class editProfile extends Component {
const id = open ? 'simple-popover' : undefined;
return (
this.state.pageLoading ?
<CircularProgress size={60} style={{marginTop: "300px"}}></CircularProgress>
:
<Grid container className={classes.form} id="container-grid">
<Grid item sm >
<Button