From: Dessalines Date: Fri, 17 Jul 2020 15:48:06 +0000 (-0400) Subject: Better user page loading indicators. Fixes #986 X-Git-Url: http://these/git/%22https:/image.com/%7BcommunityRSSUrl%28?a=commitdiff_plain;h=aaa850c6c95ce62b4c0b49e8d38cb1ffa4809114;p=lemmy.git Better user page loading indicators. Fixes #986 --- 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) {