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

Indicate deleted posts #1079

Merged
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
26 changes: 22 additions & 4 deletions lib/community/widgets/post_card_view_comfortable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class PostCardViewComfortable extends StatelessWidget {
WidgetSpan(
child: Icon(
Icons.lock,
color: indicateRead && postViewMedia.postView.read ? Colors.red.withOpacity(0.55) : Colors.red,
color: indicateRead && postViewMedia.postView.read ? Colors.orange.shade900.withOpacity(0.55) : Colors.orange.shade900,
size: 15 * textScaleFactor,
)),
],
Expand All @@ -133,7 +133,16 @@ class PostCardViewComfortable extends StatelessWidget {
color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green,
),
),
if (postViewMedia.postView.post.featuredCommunity ||
if (postViewMedia.postView.post.deleted)
WidgetSpan(
child: Icon(
Icons.delete_rounded,
size: 16 * textScaleFactor,
color: indicateRead && postViewMedia.postView.read ? Colors.red.withOpacity(0.55) : Colors.red,
),
),
if (postViewMedia.postView.post.deleted ||
postViewMedia.postView.post.featuredCommunity ||
postViewMedia.postView.post.featuredLocal ||
(!useSaveButton && postViewMedia.postView.saved) ||
postViewMedia.postView.post.locked)
Expand Down Expand Up @@ -177,7 +186,7 @@ class PostCardViewComfortable extends StatelessWidget {
WidgetSpan(
child: Icon(
Icons.lock,
color: indicateRead && postViewMedia.postView.read ? Colors.red.withOpacity(0.55) : Colors.red,
color: indicateRead && postViewMedia.postView.read ? Colors.orange.shade900.withOpacity(0.55) : Colors.orange.shade900,
size: 15 * textScaleFactor,
)),
],
Expand All @@ -198,7 +207,16 @@ class PostCardViewComfortable extends StatelessWidget {
color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green,
),
),
if (postViewMedia.postView.post.featuredCommunity ||
if (postViewMedia.postView.post.deleted)
WidgetSpan(
child: Icon(
Icons.delete_rounded,
size: 16 * textScaleFactor,
color: indicateRead && postViewMedia.postView.read ? Colors.red.withOpacity(0.55) : Colors.red,
),
),
if (postViewMedia.postView.post.deleted ||
postViewMedia.postView.post.featuredCommunity ||
postViewMedia.postView.post.featuredLocal ||
(!useSaveButton && postViewMedia.postView.saved) ||
postViewMedia.postView.post.locked)
Expand Down
16 changes: 14 additions & 2 deletions lib/community/widgets/post_card_view_compact.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class PostCardViewCompact extends StatelessWidget {
WidgetSpan(
child: Icon(
Icons.lock,
color: indicateRead && postViewMedia.postView.read ? Colors.red.withOpacity(0.55) : Colors.red,
color: indicateRead && postViewMedia.postView.read ? Colors.orange.shade900.withOpacity(0.55) : Colors.orange.shade900,
size: 15 * textScaleFactor,
),
),
Expand All @@ -102,7 +102,19 @@ class PostCardViewCompact extends StatelessWidget {
color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green,
),
),
if (postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal || postViewMedia.postView.saved || postViewMedia.postView.post.locked)
if (postViewMedia.postView.post.deleted)
WidgetSpan(
child: Icon(
Icons.delete_rounded,
size: 16 * textScaleFactor,
color: indicateRead && postViewMedia.postView.read ? Colors.red.withOpacity(0.55) : Colors.red,
),
),
if (postViewMedia.postView.post.deleted ||
postViewMedia.postView.post.featuredCommunity ||
postViewMedia.postView.post.featuredLocal ||
postViewMedia.postView.saved ||
postViewMedia.postView.post.locked)
const WidgetSpan(child: SizedBox(width: 3.5)),
TextSpan(
text: HtmlUnescape().convert(postViewMedia.postView.post.name),
Expand Down
2 changes: 1 addition & 1 deletion lib/post/widgets/post_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ class _PostSubviewState extends State<PostSubview> with SingleTickerProviderStat
}
: null,
icon: postView.post.locked
? Icon(Icons.lock, semanticLabel: l10n.postLocked, color: Colors.red)
? Icon(Icons.lock, semanticLabel: l10n.postLocked, color: Colors.orange.shade900)
: isOwnPost
? Icon(Icons.edit_rounded, semanticLabel: AppLocalizations.of(context)!.edit)
: Icon(Icons.reply_rounded, semanticLabel: l10n.reply(0)),
Expand Down
Loading