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

Label Tweaks #805

Merged
merged 1 commit into from
Dec 10, 2023
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
5 changes: 4 additions & 1 deletion Mlem/Logic/Abbreviate Numbers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
import Foundation

func abbreviateNumber(_ number: Int) -> String {
if number >= 10_000_000 {
return "\(Int(round(Double(number) / 1_000_000)))M"
}
if number >= 1_000_000 {
return "\(Double(round(Double(number) / 100) / 10))M"
return "\(Double(round(Double(number) / 100_000) / 10))M"
}
if number >= 10_000 {
return "\(Int(round(Double(number) / 1000)))K"
Expand Down
6 changes: 3 additions & 3 deletions Mlem/Models/Content/Inbox/MentionModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ extension MentionModel {

// upvote
ret.append(MenuFunction.standardMenuFunction(
text: votes.myVote == .upvote ? "Undo upvote" : "Upvote",
text: votes.myVote == .upvote ? "Undo Upvote" : "Upvote",
imageName: votes.myVote == .upvote ? Icons.upvoteSquareFill : Icons.upvoteSquare,
destructiveActionPrompt: nil,
enabled: true
Expand All @@ -222,7 +222,7 @@ extension MentionModel {

// downvote
ret.append(MenuFunction.standardMenuFunction(
text: votes.myVote == .downvote ? "Undo downvote" : "Downvote",
text: votes.myVote == .downvote ? "Undo Downvote" : "Downvote",
imageName: votes.myVote == .downvote ? Icons.downvoteSquareFill : Icons.downvoteSquare,
destructiveActionPrompt: nil,
enabled: true
Expand All @@ -234,7 +234,7 @@ extension MentionModel {

// toggle read
ret.append(MenuFunction.standardMenuFunction(
text: personMention.read ? "Mark unread" : "Mark read",
text: personMention.read ? "Mark Unread" : "Mark Read",
imageName: personMention.read ? Icons.markUnread : Icons.markRead,
destructiveActionPrompt: nil,
enabled: true
Expand Down
6 changes: 3 additions & 3 deletions Mlem/Models/Content/Inbox/ReplyModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ extension ReplyModel {

// upvote
ret.append(MenuFunction.standardMenuFunction(
text: votes.myVote == .upvote ? "Undo upvote" : "Upvote",
text: votes.myVote == .upvote ? "Undo Upvote" : "Upvote",
imageName: votes.myVote == .upvote ? Icons.upvoteSquareFill : Icons.upvoteSquare,
destructiveActionPrompt: nil,
enabled: true
Expand All @@ -217,7 +217,7 @@ extension ReplyModel {

// downvote
ret.append(MenuFunction.standardMenuFunction(
text: votes.myVote == .downvote ? "Undo downvote" : "Downvote",
text: votes.myVote == .downvote ? "Undo Downvote" : "Downvote",
imageName: votes.myVote == .downvote ? Icons.downvoteSquareFill : Icons.downvoteSquare,
destructiveActionPrompt: nil,
enabled: true
Expand All @@ -229,7 +229,7 @@ extension ReplyModel {

// toggle read
ret.append(MenuFunction.standardMenuFunction(
text: commentReply.read ? "Mark unread" : "Mark read",
text: commentReply.read ? "Mark Unread" : "Mark Read",
imageName: commentReply.read ? Icons.markUnread : Icons.markRead,
destructiveActionPrompt: nil,
enabled: true
Expand Down
4 changes: 2 additions & 2 deletions Mlem/Views/Shared/Posts/ExpandedPostLogic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ extension ExpandedPost {

// upvote
let (upvoteText, upvoteImg) = post.votes.myVote == .upvote ?
("Undo upvote", Icons.upvoteSquareFill) :
("Undo Upvote", Icons.upvoteSquareFill) :
("Upvote", Icons.upvoteSquare)
ret.append(MenuFunction.standardMenuFunction(
text: upvoteText,
Expand All @@ -111,7 +111,7 @@ extension ExpandedPost {

// downvote
let (downvoteText, downvoteImg) = post.votes.myVote == .downvote ?
("Undo downvote", Icons.downvoteSquareFill) :
("Undo Downvote", Icons.downvoteSquareFill) :
("Downvote", Icons.downvoteSquare)
ret.append(MenuFunction.standardMenuFunction(
text: downvoteText,
Expand Down
6 changes: 3 additions & 3 deletions Mlem/Views/Shared/Posts/Feed Post.swift
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ struct FeedPost: View {

// upvote
let (upvoteText, upvoteImg) = post.votes.myVote == .upvote ?
("Undo upvote", Icons.upvoteSquareFill) :
("Undo Upvote", Icons.upvoteSquareFill) :
("Upvote", Icons.upvoteSquare)
ret.append(MenuFunction.standardMenuFunction(
text: upvoteText,
Expand All @@ -313,7 +313,7 @@ struct FeedPost: View {

// downvote
let (downvoteText, downvoteImg) = post.votes.myVote == .downvote ?
("Undo downvote", Icons.downvoteSquareFill) :
("Undo Downvote", Icons.downvoteSquareFill) :
("Downvote", Icons.downvoteSquare)
ret.append(MenuFunction.standardMenuFunction(
text: downvoteText,
Expand Down Expand Up @@ -404,7 +404,7 @@ struct FeedPost: View {
ret.append(MenuFunction.standardMenuFunction(
text: "Block Community",
imageName: Icons.hide,
destructiveActionPrompt: nil,
destructiveActionPrompt: AppConstants.blockCommunityPrompt,
enabled: true
) {
Task(priority: .userInitiated) {
Expand Down