Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Comment component fixes #46

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions example/lib/pages/components/comment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ class _CommentDemoState extends State<CommentDemo> {
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(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/molecules/comment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ZdsComment extends StatelessWidget {
ZdsSlidableAction(
icon: ZetaIcons.delete,
semanticLabel: deleteSemanticLabel,
onPressed: (_) {},
onPressed: (_) => onDelete!(),
backgroundColor: colors.surfaceNegativeSubtle,
foregroundColor: colors.error,
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/organisms/chat/message_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);

Expand Down