Skip to content

Commit 32a0ce1

Browse files
committed
feat(user_content): display user email first letter in comments avatar
- Replace placeholder user icon with UserAvatar widget - Show user email if available, otherwise display partial user ID - Display "You" for comments from the current user - Update localization strings for commenter name display
1 parent 74bf191 commit 32a0ce1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/user_content/engagement/view/comments_bottom_sheet.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:flutter_news_app_mobile_client_full_source_code/headlines-feed/b
77
import 'package:flutter_news_app_mobile_client_full_source_code/l10n/app_localizations.dart';
88
import 'package:flutter_news_app_mobile_client_full_source_code/user_content/reporting/view/report_content_bottom_sheet.dart';
99
import 'package:timeago/timeago.dart' as timeago;
10+
import 'package:flutter_news_app_mobile_client_full_source_code/shared/widgets/user_avatar.dart';
1011
import 'package:ui_kit/ui_kit.dart';
1112

1213
/// {@template comments_bottom_sheet}
@@ -128,11 +129,15 @@ class __CommentsBottomSheetViewState extends State<_CommentsBottomSheetView> {
128129
final isOwnComment = user != null && engagement.userId == user.id;
129130

130131
return ListTile(
131-
leading: const CircleAvatar(child: Icon(Icons.person_outline)),
132+
leading: UserAvatar(user: user),
132133
title: Row(
133134
children: [
134135
Text(
135-
'User ${engagement.userId.substring(0, 4)}',
136+
isOwnComment
137+
? (user.email.isNotEmpty
138+
? user.email
139+
: l10n.accountNoNameUser)
140+
: l10n.commenterName(engagement.userId.substring(0, 4)),
136141
style: theme.textTheme.titleSmall,
137142
),
138143
const SizedBox(width: AppSpacing.sm),

0 commit comments

Comments
 (0)