Skip to content

Commit

Permalink
Highlight featured local posts (#991)
Browse files Browse the repository at this point in the history
  • Loading branch information
micahmo authored Jan 4, 2024
1 parent e2c03a6 commit 3855182
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
18 changes: 12 additions & 6 deletions lib/community/widgets/post_card_view_comfortable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,18 @@ class PostCardViewComfortable extends StatelessWidget {
semanticLabel: 'Saved',
),
),
if (postViewMedia.postView.post.featuredCommunity)
if (postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal)
WidgetSpan(
child: Icon(
Icons.push_pin_rounded,
size: 15 * textScaleFactor,
color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green,
),
),
if (postViewMedia.postView.post.featuredCommunity || (!useSaveButton && postViewMedia.postView.saved) || postViewMedia.postView.post.locked)
if (postViewMedia.postView.post.featuredCommunity ||
postViewMedia.postView.post.featuredLocal ||
(!useSaveButton && postViewMedia.postView.saved) ||
postViewMedia.postView.post.locked)
const WidgetSpan(
child: SizedBox(
width: 3.5,
Expand All @@ -144,7 +147,7 @@ class PostCardViewComfortable extends StatelessWidget {
style: theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
fontSize: MediaQuery.textScalerOf(context).scale(theme.textTheme.bodyMedium!.fontSize! * state.titleFontSizeScale.textScaleFactor),
color: postViewMedia.postView.post.featuredCommunity
color: postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal
? (indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green)
: (indicateRead && postViewMedia.postView.read ? theme.textTheme.bodyMedium?.color?.withOpacity(0.55) : null),
),
Expand Down Expand Up @@ -187,15 +190,18 @@ class PostCardViewComfortable extends StatelessWidget {
semanticLabel: 'Saved',
),
),
if (postViewMedia.postView.post.featuredCommunity)
if (postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal)
WidgetSpan(
child: Icon(
Icons.push_pin_rounded,
size: 15 * textScaleFactor,
color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green,
),
),
if (postViewMedia.postView.post.featuredCommunity || (!useSaveButton && postViewMedia.postView.saved) || postViewMedia.postView.post.locked)
if (postViewMedia.postView.post.featuredCommunity ||
postViewMedia.postView.post.featuredLocal ||
(!useSaveButton && postViewMedia.postView.saved) ||
postViewMedia.postView.post.locked)
const WidgetSpan(
child: SizedBox(
width: 3.5,
Expand All @@ -206,7 +212,7 @@ class PostCardViewComfortable extends StatelessWidget {
style: theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
fontSize: MediaQuery.textScalerOf(context).scale(theme.textTheme.bodyMedium!.fontSize! * state.titleFontSizeScale.textScaleFactor),
color: postViewMedia.postView.post.featuredCommunity
color: postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal
? (indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green)
: (indicateRead && postViewMedia.postView.read ? theme.textTheme.bodyMedium?.color?.withOpacity(0.55) : null),
),
Expand Down
6 changes: 3 additions & 3 deletions lib/community/widgets/post_card_view_compact.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ class PostCardViewCompact extends StatelessWidget {
semanticLabel: 'Saved',
),
),
if (postViewMedia.postView.post.featuredCommunity)
if (postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal)
WidgetSpan(
child: Icon(
Icons.push_pin_rounded,
size: 15 * textScaleFactor,
color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green,
),
),
if (postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.saved || postViewMedia.postView.post.locked)
if (postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal || postViewMedia.postView.saved || postViewMedia.postView.post.locked)
const WidgetSpan(
child: SizedBox(
width: 3.5,
Expand All @@ -142,7 +142,7 @@ class PostCardViewCompact extends StatelessWidget {
style: theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
fontSize: MediaQuery.textScalerOf(context).scale(theme.textTheme.bodyMedium!.fontSize! * state.titleFontSizeScale.textScaleFactor),
color: postViewMedia.postView.post.featuredCommunity
color: postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal
? (indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green)
: (indicateRead && postViewMedia.postView.read ? theme.textTheme.bodyMedium?.color?.withOpacity(0.55) : null),
),
Expand Down

0 comments on commit 3855182

Please sign in to comment.