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