From d02ac1804b78fc770381d3ca74eab19ebbd26ff8 Mon Sep 17 00:00:00 2001 From: Sangwoo Byeon Date: Sun, 16 Jun 2024 13:45:41 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20#189=20-=20=EB=85=B8=ED=8B=B0=EC=97=90?= =?UTF-8?q?=20=EC=9D=B8=EA=B8=B0=EA=B8=80=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DontBe-iOS/Global/Literals/StringLiterals.swift | 1 + .../Cells/NotificationTableViewCell.swift | 12 +++++++++++- .../Notification/Models/NotificaitonType.swift | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/DontBe-iOS/DontBe-iOS/Global/Literals/StringLiterals.swift b/DontBe-iOS/DontBe-iOS/Global/Literals/StringLiterals.swift index 426cb28f..fbf56d8a 100644 --- a/DontBe-iOS/DontBe-iOS/Global/Literals/StringLiterals.swift +++ b/DontBe-iOS/DontBe-iOS/Global/Literals/StringLiterals.swift @@ -87,6 +87,7 @@ enum StringLiterals { static let commentTransparency = "님, 작성하신 답글로 인해 점점 투명해지고 있어요." static let emptyTitle = "아직 받은 알림이 없어요." static let emptyDescription = "새로운 소식이 도착하면 알려드릴게요." + static let popularWriter = "님이 작성하신 글이 인기글로 선정되었어요. 🥳🥳" } enum MyPage { diff --git a/DontBe-iOS/DontBe-iOS/Presentation/Notification/Cells/NotificationTableViewCell.swift b/DontBe-iOS/DontBe-iOS/Presentation/Notification/Cells/NotificationTableViewCell.swift index 1da26cf0..e077f204 100644 --- a/DontBe-iOS/DontBe-iOS/Presentation/Notification/Cells/NotificationTableViewCell.swift +++ b/DontBe-iOS/DontBe-iOS/Presentation/Notification/Cells/NotificationTableViewCell.swift @@ -25,7 +25,7 @@ final class NotificationTableViewCell: UITableViewCell, UITableViewCellRegistera return profileImage }() - let notificationLabel: UILabel = { + var notificationLabel: UILabel = { let notificationLabel = UILabel() notificationLabel.textColor = .donGray12 notificationLabel.font = .font(.body4) @@ -148,6 +148,16 @@ extension NotificationTableViewCell { text: notificationLabel.text, targetString: list.memberNickname, font: .font(.body3)) + case .popularWriter: + nicknameLabel.text = list.memberNickname + notificationLabel.text = list.memberNickname + " " + list.notificationType.description + notificationLabel.setTextWithLineHeightAndFont( + text: notificationLabel.text, + targetString: list.memberNickname, + font: .font(.body3)) + case .popularContent: + nicknameLabel.text = "어제 가장 인기있었던 글이에요.\n" + notificationLabel.text = "" } minutes.text = list.time.formattedTime() diff --git a/DontBe-iOS/DontBe-iOS/Presentation/Notification/Models/NotificaitonType.swift b/DontBe-iOS/DontBe-iOS/Presentation/Notification/Models/NotificaitonType.swift index 3384426d..981412cd 100644 --- a/DontBe-iOS/DontBe-iOS/Presentation/Notification/Models/NotificaitonType.swift +++ b/DontBe-iOS/DontBe-iOS/Presentation/Notification/Models/NotificaitonType.swift @@ -17,6 +17,8 @@ enum NotificaitonType: String { case contentGhost = "contentGhost" case commentGhost = "commentGhost" case userBan = "userBan" + case popularWriter = "popularWriter" + case popularContent = "popularContent" var description: String { switch self { @@ -36,6 +38,10 @@ enum NotificaitonType: String { return StringLiterals.Notification.commentTransparency case .userBan: return StringLiterals.Notification.violation + case .popularWriter: + return StringLiterals.Notification.popularWriter + case .popularContent: + return StringLiterals.Notification.violation } } }