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 dim read posts setting not being applied for card view #1530

Merged
merged 1 commit into from
Aug 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
16 changes: 8 additions & 8 deletions lib/community/widgets/post_card_metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class ScorePostCardMetaData extends StatelessWidget {
}

return Container(
margin: const EdgeInsets.only(right: 4.0),
margin: const EdgeInsets.only(right: 8.0),
child: Wrap(
spacing: 2.0,
crossAxisAlignment: WrapCrossAlignment.center,
Expand Down Expand Up @@ -217,7 +217,7 @@ class UpvotePostCardMetaData extends StatelessWidget {
}

return Container(
margin: const EdgeInsets.only(right: 4.0),
margin: const EdgeInsets.only(right: 8.0),
child: IconText(
fontScale: state.metadataFontSizeScale,
text: showScores ? formatNumberToK(upvotes ?? 0) : null,
Expand Down Expand Up @@ -267,7 +267,7 @@ class DownvotePostCardMetaData extends StatelessWidget {
}

return Container(
margin: const EdgeInsets.only(right: 4.0),
margin: const EdgeInsets.only(right: 8.0),
child: IconText(
fontScale: state.metadataFontSizeScale,
text: showScores ? formatNumberToK(downvotes ?? 0) : null,
Expand Down Expand Up @@ -309,12 +309,12 @@ class CommentCountPostCardMetaData extends StatelessWidget {
};

return Container(
margin: const EdgeInsets.only(right: 4.0),
margin: const EdgeInsets.only(right: 8.0),
child: IconText(
fontScale: state.metadataFontSizeScale,
text: (unreadCommentCount > 0 && unreadCommentCount != commentCount) ? '+${formatNumberToK(unreadCommentCount)}' : formatNumberToK(commentCount ?? 0),
textColor: color,
padding: 5.0,
padding: 4.0,
icon: Icon(unreadCommentCount > 0 && unreadCommentCount != commentCount ? Icons.mark_unread_chat_alt_rounded : Icons.chat, size: 17.0, color: color),
),
);
Expand Down Expand Up @@ -351,7 +351,7 @@ class DateTimePostCardMetaData extends StatelessWidget {
};

return Container(
margin: const EdgeInsets.only(right: 4.0),
margin: const EdgeInsets.only(right: 8.0),
child: IconText(
fontScale: state.metadataFontSizeScale,
text: state.showFullPostDate ? state.dateFormat?.format(DateTime.parse(dateTime)) : formatTimeToString(dateTime: dateTime),
Expand Down Expand Up @@ -393,7 +393,7 @@ class UrlPostCardMetaData extends StatelessWidget {
}

return Container(
margin: const EdgeInsets.only(right: 4.0),
margin: const EdgeInsets.only(right: 8.0),
child: Tooltip(
message: url,
preferBelow: false,
Expand Down Expand Up @@ -443,7 +443,7 @@ class LanguagePostCardMetaData extends StatelessWidget {
}

return Container(
margin: const EdgeInsets.only(right: 4.0),
margin: const EdgeInsets.only(right: 8.0),
child: Tooltip(
message: languageId == -1 ? 'English' : language!.name,
preferBelow: false,
Expand Down
6 changes: 4 additions & 2 deletions lib/community/widgets/post_card_view_comfortable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class PostCardViewComfortable extends StatelessWidget {
final bool markPostReadOnMediaView;
final ListingType? listingType;
final void Function({PostViewMedia? postViewMedia})? navigateToPost;
final bool indicateRead;
final bool? indicateRead;

const PostCardViewComfortable({
super.key,
Expand All @@ -66,7 +66,7 @@ class PostCardViewComfortable extends StatelessWidget {
required this.onSaveAction,
required this.markPostReadOnMediaView,
required this.listingType,
required this.indicateRead,
this.indicateRead,
this.navigateToPost,
});

Expand All @@ -75,6 +75,8 @@ class PostCardViewComfortable extends StatelessWidget {
final theme = Theme.of(context);
final ThunderState state = context.read<ThunderBloc>().state;

bool indicateRead = this.indicateRead ?? state.dimReadPosts;

final showCommunitySubscription = (listingType == ListingType.all || listingType == ListingType.local) &&
isUserLoggedIn &&
context.read<AccountBloc>().state.subsciptions.map((subscription) => subscription.community.actorId).contains(postViewMedia.postView.community.actorId);
Expand Down
Loading