Implement MeetingsFragment and MeetingsView

This commit is contained in:
QuentinArguillere 2024-04-19 16:49:03 +02:00
parent 08f164fc88
commit 269eeba480
2 changed files with 67 additions and 8 deletions

View file

@ -8,11 +8,41 @@
import SwiftUI
struct MeetingsFragment: View {
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
}
@ObservedObject var scheduleMeetingViewModel: ScheduleMeetingViewModel
private var idiom: UIUserInterfaceIdiom { UIDevice.current.userInterfaceIdiom }
@State var showingSheet: Bool = false
var body: some View {
VStack {
Spacer()
Text("Hello meetings list")
Spacer()
/*
if #available(iOS 16.0, *), idiom != .pad {
MeetingsListFragment(conversationViewModel: conversationViewModel, conversationsListViewModel: conversationsListViewModel, showingSheet: $showingSheet)
.sheet(isPresented: $showingSheet) {
ConversationsListBottomSheet(
conversationsListViewModel: conversationsListViewModel,
showingSheet: $showingSheet
)
.presentationDetents([.fraction(0.4)])
}
} else {
ConversationsListFragment(conversationViewModel: conversationViewModel, conversationsListViewModel: conversationsListViewModel, showingSheet: $showingSheet)
.halfSheet(showSheet: $showingSheet) {
ConversationsListBottomSheet(
conversationsListViewModel: conversationsListViewModel,
showingSheet: $showingSheet
)
} onDismiss: {}
} */
}
}
}
#Preview {
MeetingsFragment()
MeetingsFragment(scheduleMeetingViewModel: ScheduleMeetingViewModel())
}

View file

@ -8,11 +8,40 @@
import SwiftUI
struct MeetingsView: View {
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
}
@ObservedObject var scheduleMeetingViewModel: ScheduleMeetingViewModel
@Binding var isShowScheduleMeetingFragment: Bool
var body: some View {
NavigationView {
ZStack(alignment: .bottomTrailing) {
MeetingsFragment(scheduleMeetingViewModel: scheduleMeetingViewModel)
Button {
withAnimation {
isShowScheduleMeetingFragment.toggle()
}
} label: {
Image("plus-circle")
.renderingMode(.template)
.foregroundStyle(.white)
.padding()
.background(Color.orangeMain500)
.clipShape(Circle())
.shadow(color: .black.opacity(0.2), radius: 4)
}
.padding()
}
}
.navigationViewStyle(.stack)
}
}
#Preview {
MeetingsView()
MeetingsView(
scheduleMeetingViewModel: ScheduleMeetingViewModel(),
isShowScheduleMeetingFragment: .constant(false)
)
}