From f8beb46610ad6e2d49102ee5ba3ae2633248ebd8 Mon Sep 17 00:00:00 2001 From: mikecoomber Date: Fri, 29 Nov 2024 16:12:56 +0000 Subject: [PATCH] fix: Comment component fixes --- example/lib/pages/components/comment.dart | 8 ++++++-- lib/src/components/molecules/comment.dart | 2 +- lib/src/components/organisms/chat/message_input.dart | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/example/lib/pages/components/comment.dart b/example/lib/pages/components/comment.dart index 5fd2a66..3c74281 100644 --- a/example/lib/pages/components/comment.dart +++ b/example/lib/pages/components/comment.dart @@ -23,9 +23,13 @@ class _CommentDemoState extends State { author: 'John Doe', downloadCallback: () {}, comment: 'This is a comment', - onReply: () {}, + onReply: () { + print('reply'); + }, replySemanticLabel: 'Reply to comment', - onDelete: () {}, + onDelete: () { + print('delete'); + }, deleteSemanticLabel: 'Delete', timeStamp: '09:30 AM', attachment: ZdsChatAttachment( diff --git a/lib/src/components/molecules/comment.dart b/lib/src/components/molecules/comment.dart index ed604d7..d896941 100644 --- a/lib/src/components/molecules/comment.dart +++ b/lib/src/components/molecules/comment.dart @@ -112,7 +112,7 @@ class ZdsComment extends StatelessWidget { ZdsSlidableAction( icon: ZetaIcons.delete, semanticLabel: deleteSemanticLabel, - onPressed: (_) {}, + onPressed: (_) => onDelete!(), backgroundColor: colors.surfaceNegativeSubtle, foregroundColor: colors.error, ), diff --git a/lib/src/components/organisms/chat/message_input.dart b/lib/src/components/organisms/chat/message_input.dart index d025dba..f775d3d 100644 --- a/lib/src/components/organisms/chat/message_input.dart +++ b/lib/src/components/organisms/chat/message_input.dart @@ -29,7 +29,7 @@ class ZdsMessageInput extends StatefulWidget { this.allowVoiceNotes = false, super.key, }) : assert( - allowVoiceNotes && voiceNoteFileName != null, + (allowVoiceNotes && voiceNoteFileName != null) || !allowVoiceNotes, 'A value for voiceNoteFileName must be provided if allowVoiceNotes is enabled', );