mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix: replace first and last name with single field (#4915)
This commit is contained in:
parent
413ab2c538
commit
7fca0d8da5
98 changed files with 567 additions and 1147 deletions
|
|
@ -132,7 +132,7 @@ class AppBarProfileInfoBox extends HookConsumerWidget {
|
|||
),
|
||||
),
|
||||
title: Text(
|
||||
"${authState.firstName} ${authState.lastName}",
|
||||
authState.name,
|
||||
style: TextStyle(
|
||||
color: context.primaryColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
|
|
|||
|
|
@ -7,8 +7,7 @@ import 'package:immich_mobile/shared/models/user.dart';
|
|||
Widget userAvatar(BuildContext context, User u, {double? radius}) {
|
||||
final url =
|
||||
"${Store.get(StoreKey.serverEndpoint)}/user/profile-image/${u.id}";
|
||||
final firstNameFirstLetter = u.firstName.isNotEmpty ? u.firstName[0] : "";
|
||||
final lastNameFirstLetter = u.lastName.isNotEmpty ? u.lastName[0] : "";
|
||||
final nameFirstLetter = u.name.isNotEmpty ? u.name[0] : "";
|
||||
return CircleAvatar(
|
||||
radius: radius,
|
||||
backgroundColor: context.primaryColor.withAlpha(50),
|
||||
|
|
@ -19,6 +18,6 @@ Widget userAvatar(BuildContext context, User u, {double? radius}) {
|
|||
),
|
||||
// silence errors if user has no profile image, use initials as fallback
|
||||
onForegroundImageError: (exception, stackTrace) {},
|
||||
child: Text((firstNameFirstLetter + lastNameFirstLetter).toUpperCase()),
|
||||
child: Text(nameFirstLetter.toUpperCase()),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class UserCircleAvatar extends ConsumerWidget {
|
|||
'${Store.get(StoreKey.serverEndpoint)}/user/profile-image/${user.id}?d=${Random().nextInt(1024)}';
|
||||
|
||||
final textIcon = Text(
|
||||
user.firstName[0].toUpperCase(),
|
||||
user.name[0].toUpperCase(),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: context.isDarkTheme ? Colors.black : Colors.white,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue