diff --git a/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewController.swift b/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewController.swift index bdb00cb6d..5a8f77349 100644 --- a/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewController.swift +++ b/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewController.swift @@ -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") } diff --git a/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewModel.swift b/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewModel.swift index 653c597a8..639a20d6f 100644 --- a/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewModel.swift +++ b/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewModel.swift @@ -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)" + } + } } } diff --git a/Mastodon/Scene/Notification/NotificationViewModel.swift b/Mastodon/Scene/Notification/NotificationViewModel.swift index 25fb4e33f..8b68367c1 100644 --- a/Mastodon/Scene/Notification/NotificationViewModel.swift +++ b/Mastodon/Scene/Notification/NotificationViewModel.swift @@ -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 {