mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(web,server): user avatar color (#4779)
This commit is contained in:
parent
14c7187539
commit
d25a245049
58 changed files with 1123 additions and 141 deletions
|
|
@ -22,14 +22,12 @@ class AppBarProfileInfoBox extends HookConsumerWidget {
|
|||
final user = Store.tryGet(StoreKey.currentUser);
|
||||
|
||||
buildUserProfileImage() {
|
||||
const immichImage = CircleAvatar(
|
||||
radius: 20,
|
||||
backgroundImage: AssetImage('assets/immich-logo-no-outline.png'),
|
||||
backgroundColor: Colors.transparent,
|
||||
);
|
||||
|
||||
if (authState.profileImagePath.isEmpty || user == null) {
|
||||
return immichImage;
|
||||
if (user == null) {
|
||||
return const CircleAvatar(
|
||||
radius: 20,
|
||||
backgroundImage: AssetImage('assets/immich-logo-no-outline.png'),
|
||||
backgroundColor: Colors.transparent,
|
||||
);
|
||||
}
|
||||
|
||||
final userImage = UserCircleAvatar(
|
||||
|
|
@ -38,18 +36,6 @@ class AppBarProfileInfoBox extends HookConsumerWidget {
|
|||
user: user,
|
||||
);
|
||||
|
||||
if (uploadProfileImageStatus == UploadProfileStatus.idle) {
|
||||
return authState.profileImagePath.isNotEmpty ? userImage : immichImage;
|
||||
}
|
||||
|
||||
if (uploadProfileImageStatus == UploadProfileStatus.success) {
|
||||
return userImage;
|
||||
}
|
||||
|
||||
if (uploadProfileImageStatus == UploadProfileStatus.failure) {
|
||||
return immichImage;
|
||||
}
|
||||
|
||||
if (uploadProfileImageStatus == UploadProfileStatus.loading) {
|
||||
return const SizedBox(
|
||||
height: 40,
|
||||
|
|
@ -58,7 +44,7 @@ class AppBarProfileInfoBox extends HookConsumerWidget {
|
|||
);
|
||||
}
|
||||
|
||||
return immichImage;
|
||||
return userImage;
|
||||
}
|
||||
|
||||
pickUserProfileImage() async {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue