add button for going to post

This commit is contained in:
krawieck 2021-01-16 15:20:49 +01:00
parent 2c152aeca3
commit ccedb35259
1 changed files with 10 additions and 0 deletions

View File

@ -25,6 +25,7 @@ class Comment extends HookWidget {
final int indent; final int indent;
final int postCreatorId; final int postCreatorId;
final CommentTree commentTree; final CommentTree commentTree;
final bool detatched;
final bool wasVoted; final bool wasVoted;
@ -40,6 +41,7 @@ class Comment extends HookWidget {
this.commentTree, { this.commentTree, {
this.indent = 0, this.indent = 0,
@required this.postCreatorId, @required this.postCreatorId,
this.detatched = false,
}) : wasVoted = }) : wasVoted =
(commentTree.comment.myVote ?? VoteType.none) != VoteType.none; (commentTree.comment.myVote ?? VoteType.none) != VoteType.none;
@ -279,6 +281,14 @@ class Comment extends HookWidget {
content: Text('comment copied to clipboard')))); content: Text('comment copied to clipboard'))));
}), }),
const Spacer(), const Spacer(),
if (detatched)
_CommentAction(
icon: Icons.link,
// onPressed: () {},
onPressed: () =>
goToPost(context, comment.instanceHost, comment.postId),
tooltip: 'go to post',
),
_CommentAction( _CommentAction(
icon: Icons.more_horiz, icon: Icons.more_horiz,
onPressed: () => _openMoreMenu(context), onPressed: () => _openMoreMenu(context),