From aaa850c6c95ce62b4c0b49e8d38cb1ffa4809114 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 17 Jul 2020 11:48:06 -0400 Subject: [PATCH] Better user page loading indicators. Fixes #986 --- ui/src/components/user.tsx | 72 ++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/ui/src/components/user.tsx b/ui/src/components/user.tsx index 5e5948cd..468d2980 100644 --- a/ui/src/components/user.tsx +++ b/ui/src/components/user.tsx @@ -93,7 +93,7 @@ export class User extends Component { username: null, follows: [], moderates: [], - loading: false, + loading: true, avatarLoading: false, view: User.getViewFromProps(this.props.match.view), sort: User.getSortTypeFromProps(this.props.match.sort), @@ -208,47 +208,50 @@ export class User extends Component { render() { return (
- {this.state.loading ? ( -
- - - -
- ) : ( -
-
+
+
+
+ {this.state.user.avatar && showAvatars() && ( + + )} + /u/{this.state.username} +
+ {this.state.loading ? (
- {this.state.user.avatar && showAvatars() && ( - - )} - /u/{this.state.username} + + +
- {this.selects()} - -
+ ) : ( + this.selects() + )} + +
+ + {!this.state.loading && (
{this.userInfo()} {this.isCurrentUser && this.userSettings()} {this.moderates()} {this.follows()}
-
- )} + )} +
); } @@ -1042,6 +1045,7 @@ export class User extends Component { UserService.Instance.user.show_avatars; this.state.userSettingsForm.matrix_user_id = this.state.user.matrix_user_id; } + this.state.loading = false; this.setState(this.state); } } else if (res.op == UserOperation.SaveUserSettings) { -- 2.44.1