Fix settings close button

This commit is contained in:
Thomas Ricouard 2023-11-18 11:58:04 +01:00
parent c1c7c666cb
commit 1e35ffb82b
3 changed files with 5 additions and 3 deletions

View file

@ -101,7 +101,7 @@ extension View {
StatusEditHistoryView(statusId: status) StatusEditHistoryView(statusId: status)
.withEnvironments() .withEnvironments()
case .settings: case .settings:
SettingsTabs(popToRootTab: .constant(.settings)) SettingsTabs(popToRootTab: .constant(.settings), isModal: true)
.withEnvironments() .withEnvironments()
.preferredColorScheme(Theme.shared.selectedScheme == .dark ? .dark : .light) .preferredColorScheme(Theme.shared.selectedScheme == .dark ? .dark : .light)
case .accountPushNotficationsSettings: case .accountPushNotficationsSettings:

View file

@ -29,6 +29,8 @@ struct SettingsTabs: View {
@State private var timelineCache = TimelineCache() @State private var timelineCache = TimelineCache()
@Binding var popToRootTab: Tab @Binding var popToRootTab: Tab
let isModal: Bool
@Query(sort: \LocalTimeline.creationDate, order: .reverse) var localTimelines: [LocalTimeline] @Query(sort: \LocalTimeline.creationDate, order: .reverse) var localTimelines: [LocalTimeline]
@Query(sort: \TagGroup.creationDate, order: .reverse) var tagGroups: [TagGroup] @Query(sort: \TagGroup.creationDate, order: .reverse) var tagGroups: [TagGroup]
@ -48,7 +50,7 @@ struct SettingsTabs: View {
.navigationBarTitleDisplayMode(.inline) .navigationBarTitleDisplayMode(.inline)
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar) .toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
.toolbar { .toolbar {
if UIDevice.current.userInterfaceIdiom == .phone { if UIDevice.current.userInterfaceIdiom == .phone || isModal {
ToolbarItem { ToolbarItem {
Button { Button {
dismiss() dismiss()

View file

@ -47,7 +47,7 @@ enum Tab: Int, Identifiable, Hashable {
case .messages: case .messages:
MessagesTab(popToRootTab: popToRootTab) MessagesTab(popToRootTab: popToRootTab)
case .settings: case .settings:
SettingsTabs(popToRootTab: popToRootTab) SettingsTabs(popToRootTab: popToRootTab, isModal: false)
case .profile: case .profile:
ProfileTab(popToRootTab: popToRootTab) ProfileTab(popToRootTab: popToRootTab)
case .other: case .other: