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

Improve post/comment bottom sheets #1199

Merged
merged 2 commits into from
Mar 14, 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
615 changes: 425 additions & 190 deletions lib/community/utils/post_card_action_helpers.dart

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions lib/community/widgets/post_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -236,22 +236,6 @@ class _PostCardState extends State<PostCard> {
onLongPress: () => showPostActionBottomModalSheet(
context,
widget.postViewMedia,
actionsToInclude: [
PostCardAction.visitInstance,
PostCardAction.visitProfile,
PostCardAction.blockUser,
PostCardAction.blockInstance,
PostCardAction.visitCommunity,
widget.postViewMedia.postView.subscribed == SubscribedType.notSubscribed ? PostCardAction.subscribeToCommunity : PostCardAction.unsubscribeFromCommunity,
PostCardAction.blockCommunity,
],
multiActionsToInclude: [
PostCardAction.upvote,
PostCardAction.downvote,
PostCardAction.save,
PostCardAction.toggleRead,
PostCardAction.share,
],
),
onTap: () async {
PostView postView = widget.postViewMedia.postView;
Expand Down
16 changes: 0 additions & 16 deletions lib/community/widgets/post_card_view_comfortable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -318,22 +318,6 @@ class PostCardViewComfortable extends StatelessWidget {
showPostActionBottomModalSheet(
context,
postViewMedia,
actionsToInclude: [
PostCardAction.visitInstance,
PostCardAction.visitProfile,
PostCardAction.blockUser,
PostCardAction.blockInstance,
PostCardAction.visitCommunity,
postViewMedia.postView.subscribed == SubscribedType.notSubscribed ? PostCardAction.subscribeToCommunity : PostCardAction.unsubscribeFromCommunity,
PostCardAction.blockCommunity,
],
multiActionsToInclude: [
PostCardAction.upvote,
PostCardAction.downvote,
PostCardAction.save,
PostCardAction.toggleRead,
PostCardAction.share,
],
);
HapticFeedback.mediumImpact();
}),
Expand Down
24 changes: 24 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,14 @@
"@communities": {},
"community": "Community",
"@community": {},
"communityActions": "Community Actions",
"@communityActions": {
"description": "Heading for community actions page"
},
"communityEntry": "Community '{community}'",
"@communityEntry": {
"description": "Entry in list for a community to perform further actions"
},
"communityFormat": "Community Format",
"@communityFormat": {
"description": "Setting for community full name format"
Expand Down Expand Up @@ -655,6 +663,14 @@
"@instance": {
"description": "Heading for an instance"
},
"instanceActions": "Instance Actions",
"@instanceActions": {
"description": "Heading for instance actions page"
},
"instanceEntry": "Instance '{username}'",
"@instanceEntry": {
"description": "Entry in list for a instance to perform further actions"
},
"instanceHasAlreadyBenAdded": "{instance} has already been added.",
"@instanceHasAlreadyBenAdded": {},
"internetOrInstanceIssues": "You may not be connected to the Internet, or your instance may be currently unavailable.",
Expand Down Expand Up @@ -1669,6 +1685,14 @@
"@user": {
"description": "Role name for user"
},
"userActions": "User Actions",
"@userActions": {
"description": "Heading for user actions page"
},
"userEntry": "User '{username}'",
"@userEntry": {
"description": "Entry in list for a user to perform further actions"
},
"userFormat": "User Format",
"@userFormat": {
"description": "Setting for user full name format"
Expand Down
15 changes: 8 additions & 7 deletions lib/post/pages/create_comment_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,14 @@ class _CreateCommentPageState extends State<CreateCommentPage> {
style: theme.textTheme.titleMedium,
),
),
MediaView(
scrapeMissingPreviews: thunderState.scrapeMissingPreviews,
postViewMedia: widget.postView!,
hideNsfwPreviews: thunderState.hideNsfwPreviews,
markPostReadOnMediaView: thunderState.markPostReadOnMediaView,
isUserLoggedIn: true,
),
if (widget.postView != null)
MediaView(
scrapeMissingPreviews: thunderState.scrapeMissingPreviews,
postViewMedia: widget.postView!,
hideNsfwPreviews: thunderState.hideNsfwPreviews,
markPostReadOnMediaView: thunderState.markPostReadOnMediaView,
isUserLoggedIn: true,
),
const SizedBox(
height: 12,
),
Expand Down
Loading
Loading