From d40157d581e5f5f0757b60a3ff6eb85b472438bc Mon Sep 17 00:00:00 2001 From: Reagan Bohan Date: Tue, 26 Mar 2024 22:10:47 +1300 Subject: [PATCH] Hide tab bar when exporting --- CubeTime/Sessions/ImportExport.swift | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/CubeTime/Sessions/ImportExport.swift b/CubeTime/Sessions/ImportExport.swift index b6ea4fe..346bdba 100644 --- a/CubeTime/Sessions/ImportExport.swift +++ b/CubeTime/Sessions/ImportExport.swift @@ -15,6 +15,7 @@ struct ImportFlow: View { struct ExportFlowPickSessions: View { @EnvironmentObject var stopwatchManager: StopwatchManager + @EnvironmentObject var tabRouter: TabRouter @StateObject var exportViewModel: ExportViewModel = ExportViewModel() @Environment(\.horizontalSizeClass) var hSizeClass @@ -78,17 +79,15 @@ struct ExportFlowPickSessions: View { } } .padding(.horizontal) - .if(!(UIDevice.deviceIsPad && hSizeClass == .regular)) { view in - view - .padding(.bottom, 58) - .padding(.bottom, UIDevice.hasBottomBar ? 0 : nil) - } - .if(UIDevice.deviceIsPad && hSizeClass == .regular) { view in - view - .padding(.bottom, 8) - } + .padding(.bottom, UIDevice.deviceIsPad && hSizeClass == .regular ? 8 : (UIDevice.hasBottomBar ? 0 : nil)) } } + .onAppear { + tabRouter.hideTabBar = true + } + .onDisappear { + tabRouter.hideTabBar = false + } } } @@ -172,15 +171,7 @@ struct ExportFlowPickFormats: View { } } .padding(.horizontal) - .if(!(UIDevice.deviceIsPad && hSizeClass == .regular)) { view in - view - .padding(.bottom, 58) - .padding(.bottom, UIDevice.hasBottomBar ? 0 : nil) - } - .if(UIDevice.deviceIsPad && hSizeClass == .regular) { view in - view - .padding(.bottom, 8) - } + .padding(.bottom, UIDevice.deviceIsPad && hSizeClass == .regular ? 8 : (UIDevice.hasBottomBar ? 0 : nil)) } } .fileExporter(isPresented: $showFilePathSave, documents: exportViewModel.selectedFormats, contentType: .data ,onCompletion: { result in