Skip to content

Commit 6bfe471

Browse files
author
chimnayajith
committed
reactions: Add sheet to view who reacted to a message
Fixes #740
1 parent c9f35b0 commit 6bfe471

12 files changed

+359
-3
lines changed

assets/l10n/app_en.arb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@
104104
"@actionSheetOptionShare": {
105105
"description": "Label for share button on action sheet."
106106
},
107+
"actionSheetOptionViewReactions": "View Reactions",
108+
"@actionSheetOptionViewReactions": {
109+
"description": "Label for View Reactions button on action sheet."
110+
},
107111
"actionSheetOptionQuoteAndReply": "Quote and reply",
108112
"@actionSheetOptionQuoteAndReply": {
109113
"description": "Label for Quote and reply button on action sheet."

lib/generated/l10n/zulip_localizations.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,12 @@ abstract class ZulipLocalizations {
261261
/// **'Share'**
262262
String get actionSheetOptionShare;
263263

264+
/// Label for View Reactions button on action sheet.
265+
///
266+
/// In en, this message translates to:
267+
/// **'View Reactions'**
268+
String get actionSheetOptionViewReactions;
269+
264270
/// Label for Quote and reply button on action sheet.
265271
///
266272
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
8888
@override
8989
String get actionSheetOptionShare => 'Share';
9090

91+
@override
92+
String get actionSheetOptionViewReactions => 'View Reactions';
93+
9194
@override
9295
String get actionSheetOptionQuoteAndReply => 'Quote and reply';
9396

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
8888
@override
8989
String get actionSheetOptionShare => 'Share';
9090

91+
@override
92+
String get actionSheetOptionViewReactions => 'View Reactions';
93+
9194
@override
9295
String get actionSheetOptionQuoteAndReply => 'Quote and reply';
9396

lib/generated/l10n/zulip_localizations_ja.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
8888
@override
8989
String get actionSheetOptionShare => 'Share';
9090

91+
@override
92+
String get actionSheetOptionViewReactions => 'View Reactions';
93+
9194
@override
9295
String get actionSheetOptionQuoteAndReply => 'Quote and reply';
9396

lib/generated/l10n/zulip_localizations_nb.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
8888
@override
8989
String get actionSheetOptionShare => 'Share';
9090

91+
@override
92+
String get actionSheetOptionViewReactions => 'View Reactions';
93+
9194
@override
9295
String get actionSheetOptionQuoteAndReply => 'Quote and reply';
9396

lib/generated/l10n/zulip_localizations_pl.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
8888
@override
8989
String get actionSheetOptionShare => 'Udostępnij';
9090

91+
@override
92+
String get actionSheetOptionViewReactions => 'View Reactions';
93+
9194
@override
9295
String get actionSheetOptionQuoteAndReply => 'Odpowiedz cytując';
9396

lib/generated/l10n/zulip_localizations_ru.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
8888
@override
8989
String get actionSheetOptionShare => 'Поделиться';
9090

91+
@override
92+
String get actionSheetOptionViewReactions => 'View Reactions';
93+
9194
@override
9295
String get actionSheetOptionQuoteAndReply => 'Ответить с цитированием';
9396

lib/generated/l10n/zulip_localizations_sk.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
8888
@override
8989
String get actionSheetOptionShare => 'Zdielať';
9090

91+
@override
92+
String get actionSheetOptionViewReactions => 'View Reactions';
93+
9194
@override
9295
String get actionSheetOptionQuoteAndReply => 'Citovať a odpovedať';
9396

lib/widgets/action_sheet.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,8 @@ void showMessageActionSheet({required BuildContext context, required Message mes
378378

379379
final optionButtons = [
380380
ReactionButtons(message: message, pageContext: context),
381+
if((message.reactions?.total ?? 0) > 0)
382+
ViewReactionsButton(message: message, pageContext: context),
381383
StarButton(message: message, pageContext: context),
382384
if (isComposeBoxOffered)
383385
QuoteAndReplyButton(message: message, pageContext: context),
@@ -678,6 +680,24 @@ class QuoteAndReplyButton extends MessageActionSheetMenuItemButton {
678680
}
679681
}
680682

683+
class ViewReactionsButton extends MessageActionSheetMenuItemButton {
684+
ViewReactionsButton({super.key, required super.message, required super.pageContext});
685+
686+
@override IconData get icon => ZulipIcons.reactions;
687+
688+
@override
689+
String label(ZulipLocalizations zulipLocalizations) {
690+
return zulipLocalizations.actionSheetOptionViewReactions;
691+
}
692+
693+
@override void onPressed() async {
694+
showReactionListSheet(
695+
pageContext,
696+
reactionList: message.reactions?.aggregated,
697+
);
698+
}
699+
}
700+
681701
class MarkAsUnreadButton extends MessageActionSheetMenuItemButton {
682702
MarkAsUnreadButton({super.key, required super.message, required super.pageContext});
683703

0 commit comments

Comments
 (0)