Notify level in channel

This commit is contained in:
2024-06-09 00:09:01 +08:00
parent 6acbd1ee9e
commit 0f24ac03f7
12 changed files with 178 additions and 39 deletions

View File

@ -65,9 +65,14 @@ class _ChannelDeletionDialogState extends State<ChannelDeletionDialog> {
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text('channelDeletionConfirm'.tr),
title: Text(widget.isOwned
? 'channelDeletionConfirm'.tr
: 'channelLeaveConfirm'.tr),
content: Text(
widget.isOwned ?
'channelDeletionConfirmCaption'
.trParams({'channel': '#${widget.channel.alias}'}) :
'channelLeaveConfirmCaption'
.trParams({'channel': '#${widget.channel.alias}'}),
),
actions: <Widget>[

View File

@ -113,7 +113,7 @@ class _ChatMessageInputState extends State<ChatMessageInput> {
Response resp;
if (_editTo != null) {
resp = await client.put(
'/api/channels/${widget.realm}/${widget.channel.alias}/messages/${widget.edit!.id}',
'/api/channels/${widget.realm}/${widget.channel.alias}/messages/${_editTo!.id}',
payload,
);
} else {
@ -171,6 +171,11 @@ class _ChatMessageInputState extends State<ChatMessageInput> {
MaterialBanner(
leading: const FaIcon(FontAwesomeIcons.reply, size: 18),
dividerColor: Colors.transparent,
padding: const EdgeInsets.only(left: 20),
backgroundColor: Theme.of(context)
.colorScheme
.surfaceContainerHighest
.withOpacity(0.5),
content: ChatMessage(
item: _replyTo!,
isContentPreviewing: true,
@ -181,6 +186,11 @@ class _ChatMessageInputState extends State<ChatMessageInput> {
MaterialBanner(
leading: const Icon(Icons.edit),
dividerColor: Colors.transparent,
padding: const EdgeInsets.only(left: 20),
backgroundColor: Theme.of(context)
.colorScheme
.surfaceContainerHighest
.withOpacity(0.5),
content: ChatMessage(
item: _editTo!,
isContentPreviewing: true,

View File

@ -61,10 +61,15 @@ class _RealmDeletionDialogState extends State<RealmDeletionDialog> {
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text('realmDeletionConfirm'.tr),
title: Text(widget.isOwned
? 'realmDeletionConfirm'.tr
: 'channelLeaveConfirm'.tr),
content: Text(
'realmDeletionConfirmCaption'
.trParams({'realm': '#${widget.realm.alias}'}),
widget.isOwned
? 'realmDeletionConfirmCaption'
.trParams({'realm': '#${widget.realm.alias}'})
: 'realmLeaveConfirmCaption'
.trParams({'realm': '#${widget.realm.alias}'}),
),
actions: <Widget>[
TextButton(