mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 08:10:59 +00:00
Fix timeline menu titles
This commit is contained in:
parent
038385c2c7
commit
bc59acd160
1 changed files with 7 additions and 6 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import KingfisherSwiftUI
|
import KingfisherSwiftUI
|
||||||
|
import enum Mastodon.Timeline
|
||||||
import ViewModels
|
import ViewModels
|
||||||
|
|
||||||
struct TabNavigationView: View {
|
struct TabNavigationView: View {
|
||||||
|
@ -44,11 +45,11 @@ private extension TabNavigationView {
|
||||||
StatusListView(viewModel: viewModel.viewModel(timeline: viewModel.timeline))
|
StatusListView(viewModel: viewModel.viewModel(timeline: viewModel.timeline))
|
||||||
.id(viewModel.timeline.id)
|
.id(viewModel.timeline.id)
|
||||||
.edgesIgnoringSafeArea(.all)
|
.edgesIgnoringSafeArea(.all)
|
||||||
.navigationBarTitle(timelineTitle, displayMode: .inline)
|
.navigationBarTitle(viewModel.timeline.title, displayMode: .inline)
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem(placement: .principal) {
|
ToolbarItem(placement: .principal) {
|
||||||
VStack {
|
VStack {
|
||||||
Text(timelineTitle)
|
Text(viewModel.timeline.title)
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
Text(viewModel.timelineSubtitle)
|
Text(viewModel.timelineSubtitle)
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
|
@ -63,7 +64,7 @@ private extension TabNavigationView {
|
||||||
Button {
|
Button {
|
||||||
viewModel.timeline = timeline
|
viewModel.timeline = timeline
|
||||||
} label: {
|
} label: {
|
||||||
Label(timelineTitle,
|
Label(timeline.title,
|
||||||
systemImage: viewModel.systemImageName(timeline: timeline))
|
systemImage: viewModel.systemImageName(timeline: timeline))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,9 +103,9 @@ private extension TabNavigationView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private extension TabNavigationView {
|
private extension Timeline {
|
||||||
var timelineTitle: String {
|
var title: String {
|
||||||
switch viewModel.timeline {
|
switch self {
|
||||||
case .home:
|
case .home:
|
||||||
return NSLocalizedString("timelines.home", comment: "")
|
return NSLocalizedString("timelines.home", comment: "")
|
||||||
case .local:
|
case .local:
|
||||||
|
|
Loading…
Reference in a new issue