Skip to content

Commit

Permalink
✨ (LekaApp): Add Care Receiver Picker before activity
Browse files Browse the repository at this point in the history
  • Loading branch information
HPezz committed Feb 27, 2024
1 parent 5052d94 commit 7ec6d17
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ struct SampleActivityListView: View {
.toolbar {
ToolbarItem {
Button {
self.navigation.currentActivity = activity
self.isCarereceiverPickerPresented = true
self.selectedActivity = activity
} label: {
Image(systemName: "play.circle")
Text("Start activity")
Expand All @@ -40,11 +41,23 @@ struct SampleActivityListView: View {
}
}
.navigationTitle("Sample Activities")
.sheet(isPresented: self.$isCarereceiverPickerPresented) {
NavigationStack {
CarereceiverPicker {
self.isCarereceiverPickerPresented = false
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
self.navigation.currentActivity = self.selectedActivity
}
}
}
}
}

// MARK: Private

private var navigation = Navigation.shared
@State private var selectedActivity: Activity?
@State private var isCarereceiverPickerPresented = false
}

#Preview {
Expand Down

0 comments on commit 7ec6d17

Please sign in to comment.