This commit is contained in:
Thomas Ricouard 2023-01-01 18:31:23 +01:00
parent 9f009376f5
commit e7264a0525
2 changed files with 9 additions and 23 deletions

View File

@ -11,7 +11,7 @@ struct IceCubesApp: App {
@Environment(\.scenePhase) private var scenePhase
@StateObject private var appAccountsManager = AppAccountsManager()
@StateObject private var currenInstance = CurrentInstance()
@StateObject private var currentInstance = CurrentInstance()
@StateObject private var currentAccount = CurrentAccount()
@StateObject private var watcher = StreamWatcher()
@StateObject private var quickLook = QuickLook()
@ -54,7 +54,7 @@ struct IceCubesApp: App {
.environmentObject(appAccountsManager.currentClient)
.environmentObject(quickLook)
.environmentObject(currentAccount)
.environmentObject(currenInstance)
.environmentObject(currentInstance)
.environmentObject(theme)
.environmentObject(watcher)
.quickLookPreview($quickLook.url, in: quickLook.urls)
@ -75,7 +75,7 @@ struct IceCubesApp: App {
private func setNewClientsInEnv(client: Client) {
currentAccount.setClient(client: client)
currenInstance.setClient(client: client)
currentInstance.setClient(client: client)
watcher.setClient(client: client)
}

View File

@ -23,7 +23,7 @@ struct TimelineTab: View {
.withAppRouteur()
.withSheetDestinations(sheetDestinations: $routeurPath.presentedSheet)
.toolbar {
ToolbarItem(placement: .principal) {
ToolbarTitleMenu {
timelineFilterButton
}
if client.isAuth {
@ -60,27 +60,13 @@ struct TimelineTab: View {
private var timelineFilterButton: some View {
Menu {
ForEach(TimelineFilter.availableTimeline(client: client), id: \.self) { timeline in
Button {
self.timeline = timeline
} label: {
Label(timeline.title(), systemImage: timeline.iconName() ?? "")
}
ForEach(TimelineFilter.availableTimeline(client: client), id: \.self) { timeline in
Button {
self.timeline = timeline
} label: {
Label(timeline.title(), systemImage: timeline.iconName() ?? "")
}
} label: {
HStack {
Text(timeline.title())
Image(systemName: "chevron.down")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 12)
.offset(y: 2)
}
.font(.headline)
.foregroundColor(theme.labelColor)
}
.menuStyle(.button)
}
private var accountButton: some View {