@ -23,6 +23,7 @@ struct ContentView<T : AbstractTimer>: View {
@ State private var siriTipShown : Bool = false
@ State var showAddSheet : Bool = false
@ State private var showSettingsSheet : Bool = false
@ State private var showStatsSheet : Bool = false
@ State private var showSubscriptionSheet : Bool = false
@ -42,6 +43,7 @@ struct ContentView<T : AbstractTimer>: View {
TimersView ( isEditing : self . $ isEditing ,
showSubscriptionSheet : self . $ showSubscriptionSheet ,
showAddSheet : self . $ showAddSheet ,
siriHandler : { timer in
self . _handleSiriTips ( timer : timer )
} )
@ -80,7 +82,7 @@ struct ContentView<T : AbstractTimer>: View {
. sheet ( isPresented : self . $ boringContext . isShowingNewData , content : {
} )
. toolbar {
MainToolbarView ( isEditing : self . $ isEditing )
MainToolbarView ( isEditing : self . $ isEditing , showAddSheet : self . $ showAddSheet )
}
. onAppear {
self . showTip = Preferences . tipToShow
@ -136,7 +138,6 @@ struct ContentView<T : AbstractTimer>: View {
}
}
}
}
} else {
@ -150,10 +151,10 @@ struct ContentView<T : AbstractTimer>: View {
struct MainToolbarView : ToolbarContent {
@ Binding var isEditing : Bool
@ Binding var showAddSheet : Bool
@ State var showSettingsSheet : Bool = false
@ State var showStatsSheet : Bool = false
@ State var showAddSheet : Bool = false
@ FetchRequest (
sortDescriptors : [ NSSortDescriptor ( keyPath : \ AbstractTimer . order , ascending : true ) ] ,
@ -176,20 +177,6 @@ struct MainToolbarView: ToolbarContent {
}
}
ToolbarItemGroup ( placement : . navigationBarTrailing ) {
// i f ! s e l f . r e c o r d s . i s E m p t y {
// B u t t o n {
// w i t h A n i m a t i o n {
// s e l f . s h o w S t a t s S h e e t . t o g g l e ( )
// }
// } l a b e l : {
// I m a g e ( s y s t e m N a m e : " s c r o l l " )
// }
// . s h e e t ( i s P r e s e n t e d : s e l f . $ s h o w S t a t s S h e e t , c o n t e n t : {
// N a v i g a t i o n S t a c k {
// A c t i v i t i e s V i e w ( )
// }
// } )
// }
if ! self . timers . isEmpty {
Button {
withAnimation {
@ -263,7 +250,7 @@ struct Toolbar_Previews: PreviewProvider {
}
. navigationTitle ( " Title " )
. toolbar {
MainToolbarView ( isEditing : . constant ( false ) )
MainToolbarView ( isEditing : . constant ( false ) , showAddSheet : . constant ( false ) )
}
}
}