Skip to content

Commit

Permalink
Label Tweaks (#805)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjmarf authored and EricBAndrews committed Dec 18, 2023
1 parent e16af92 commit 765ee3b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
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

0 comments on commit 765ee3b

Please sign in to comment.