Skip to content

Commit 38a2c63

Browse files
chrisbobbegnprice
authored andcommitted
compose: Use "info" intent, not "danger", for cannot-post-here banners
Fixes #1870.
1 parent 0f40879 commit 38a2c63

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/widgets/compose_box.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,7 @@ class _ComposeBoxState extends State<ComposeBox> with PerAccountStoreAwareStateM
21292129
}
21302130

21312131
/// A [_Banner] that replaces the compose box's text inputs.
2132-
Widget? _errorBannerComposingNotAllowed(BuildContext context) {
2132+
Widget? _bannerComposingNotAllowed(BuildContext context) {
21332133
final store = PerAccountStoreWidget.of(context);
21342134
final zulipLocalizations = ZulipLocalizations.of(context);
21352135
switch (widget.narrow) {
@@ -2139,7 +2139,7 @@ class _ComposeBoxState extends State<ComposeBox> with PerAccountStoreAwareStateM
21392139
if (channel == null || !store.selfCanSendMessage(inChannel: channel,
21402140
byDate: DateTime.now())) {
21412141
return _Banner(
2142-
intent: _BannerIntent.danger,
2142+
intent: _BannerIntent.info,
21432143
label: zulipLocalizations.errorBannerCannotPostInChannelLabel);
21442144
}
21452145

@@ -2148,7 +2148,7 @@ class _ComposeBoxState extends State<ComposeBox> with PerAccountStoreAwareStateM
21482148
!(store.getUser(id)?.isActive ?? true));
21492149
if (hasDeactivatedUser) {
21502150
return _Banner(
2151-
intent: _BannerIntent.danger,
2151+
intent: _BannerIntent.info,
21522152
label: zulipLocalizations.errorBannerDeactivatedDmLabel);
21532153
}
21542154

@@ -2165,10 +2165,10 @@ class _ComposeBoxState extends State<ComposeBox> with PerAccountStoreAwareStateM
21652165
Widget build(BuildContext context) {
21662166
final zulipLocalizations = ZulipLocalizations.of(context);
21672167

2168-
final errorBanner = _errorBannerComposingNotAllowed(context);
2169-
if (errorBanner != null) {
2168+
final bannerComposingNotAllowed = _bannerComposingNotAllowed(context);
2169+
if (bannerComposingNotAllowed != null) {
21702170
return ComposeBoxInheritedWidget.fromComposeBoxState(this,
2171-
child: _ComposeBoxContainer(body: null, banner: errorBanner));
2171+
child: _ComposeBoxContainer(body: null, banner: bannerComposingNotAllowed));
21722172
}
21732173

21742174
final Widget? body;

0 commit comments

Comments
 (0)