2
2
mirror of https://github.com/mastodon/mastodon-ios synced 2025-04-11 22:58:02 +02:00

Set title and fix background color (IOS-241)

This commit is contained in:
Nathan Mattes 2024-07-18 10:38:16 +02:00
parent 8115aea0db
commit 1a123d04be
3 changed files with 16 additions and 14 deletions

View File

@ -31,7 +31,7 @@ final class NotificationTimelineViewController: UIViewController, NeedsDependenc
private(set) lazy var tableView: UITableView = {
let tableView = UITableView()
tableView.backgroundColor = .clear
tableView.backgroundColor = .secondarySystemBackground
tableView.rowHeight = UITableView.automaticDimension
tableView.separatorStyle = .none
return tableView
@ -45,6 +45,9 @@ final class NotificationTimelineViewController: UIViewController, NeedsDependenc
self.coordinator = coordinator
super.init(nibName: nil, bundle: nil)
title = viewModel.scope.title
view.backgroundColor = .secondarySystemBackground
}
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }

View File

@ -11,6 +11,7 @@ import CoreDataStack
import GameplayKit
import MastodonSDK
import MastodonCore
import MastodonLocalization
final class NotificationTimelineViewModel {
@ -96,6 +97,17 @@ extension NotificationTimelineViewModel {
case everything
case mentions
case fromAccount(Mastodon.Entity.Account)
var title: String {
switch self {
case .everything:
return L10n.Scene.Notification.Title.everything
case .mentions:
return L10n.Scene.Notification.Title.mentions
case .fromAccount(let account):
return "Notifications from \(account.displayName)"
}
}
}
}

View File

@ -64,19 +64,6 @@ final class NotificationViewModel {
}
}
}
extension NotificationTimelineViewModel.Scope {
var title: String {
switch self {
case .everything:
return L10n.Scene.Notification.Title.everything
case .mentions:
return L10n.Scene.Notification.Title.mentions
case .fromAccount(let account):
return "Notifications from \(account.displayName)"
}
}
}
// MARK: - PageboyViewControllerDataSource
extension NotificationViewModel: PageboyViewControllerDataSource {