Skip to content

Commit c3a0c40

Browse files
committed
inbox [nfc]: Generalize _AtMentionMarker to take different icons
This is helpful for adding marker of topic visibility. Signed-off-by: Zixuan James Li <[email protected]>
1 parent b1cdf55 commit c3a0c40

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/widgets/inbox.dart

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ abstract class _HeaderItem extends StatelessWidget {
291291
overflow: TextOverflow.ellipsis,
292292
title))),
293293
const SizedBox(width: 12),
294-
if (hasMention) const _AtMentionMarker(),
294+
if (hasMention) const _IconMarker(icon: ZulipIcons.at_sign),
295295
Padding(padding: const EdgeInsetsDirectional.only(end: 16),
296296
child: UnreadCountBadge(
297297
backgroundColor: unreadCountBadgeBackgroundColor(context),
@@ -414,7 +414,7 @@ class _DmItem extends StatelessWidget {
414414
overflow: TextOverflow.ellipsis,
415415
title))),
416416
const SizedBox(width: 12),
417-
if (hasMention) const _AtMentionMarker(),
417+
if (hasMention) const _IconMarker(icon: ZulipIcons.at_sign),
418418
Padding(padding: const EdgeInsetsDirectional.only(end: 16),
419419
child: UnreadCountBadge(backgroundColor: null,
420420
count: count)),
@@ -539,7 +539,7 @@ class _TopicItem extends StatelessWidget {
539539
overflow: TextOverflow.ellipsis,
540540
topic))),
541541
const SizedBox(width: 12),
542-
if (hasMention) const _AtMentionMarker(),
542+
if (hasMention) const _IconMarker(icon: ZulipIcons.at_sign),
543543
Padding(padding: const EdgeInsetsDirectional.only(end: 16),
544544
child: UnreadCountBadge(
545545
backgroundColor: colorSwatchFor(context, subscription),
@@ -548,8 +548,10 @@ class _TopicItem extends StatelessWidget {
548548
}
549549
}
550550

551-
class _AtMentionMarker extends StatelessWidget {
552-
const _AtMentionMarker();
551+
class _IconMarker extends StatelessWidget {
552+
const _IconMarker({required this.icon});
553+
554+
final IconData icon;
553555

554556
@override
555557
Widget build(BuildContext context) {
@@ -558,6 +560,6 @@ class _AtMentionMarker extends StatelessWidget {
558560
// https://www.figma.com/file/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?type=design&node-id=224-16386&mode=design&t=JsNndFQ8fKFH0SjS-0
559561
return Padding(
560562
padding: const EdgeInsetsDirectional.only(end: 4),
561-
child: Icon(ZulipIcons.at_sign, size: 14, color: designVariables.atMentionMarker));
563+
child: Icon(icon, size: 14, color: designVariables.atMentionMarker));
562564
}
563565
}

0 commit comments

Comments
 (0)