From a4cce0b75ec3a616641ecf8b073b52b7d69c2b58 Mon Sep 17 00:00:00 2001 From: Clayton Wilson Date: Tue, 3 Dec 2019 16:26:54 -0500 Subject: [PATCH] Circular progress when the editProfile page is loading --- twistter-frontend/src/pages/editProfile.js | 354 +++++++++++---------- 1 file changed, 180 insertions(+), 174 deletions(-) diff --git a/twistter-frontend/src/pages/editProfile.js b/twistter-frontend/src/pages/editProfile.js index 539fc8b..df947fb 100644 --- a/twistter-frontend/src/pages/editProfile.js +++ b/twistter-frontend/src/pages/editProfile.js @@ -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,187 +174,190 @@ export class editProfile extends Component { const id = open ? 'simple-popover' : undefined; return ( - - - - - - - Edit Profile - -
- - - - - - - - - - - + this.state.pageLoading ? + + : + + - - - - - - - - - + + + Edit Profile + +
+ + + + + + + + + + + + + + +
+ + + + + - - - Are you sure you want to delete your account? + + + + Are you sure you want to delete your account? + + + + + - - - - - -
-
-
+ + +
); } }