diff --git a/Linphone/UI/Main/Meetings/Fragments/AddParticipantsFragment.swift b/Linphone/UI/Main/Meetings/Fragments/AddParticipantsFragment.swift new file mode 100644 index 000000000..8775ce5d8 --- /dev/null +++ b/Linphone/UI/Main/Meetings/Fragments/AddParticipantsFragment.swift @@ -0,0 +1,233 @@ +// +// ParticipantsListFragment.swift +// Linphone +// +// Created by QuentinArguillere on 16/04/2024. +// + +import SwiftUI +import Foundation +import linphonesw + +struct AddParticipantsFragment: View { + + @Environment(\.dismiss) var dismiss + + private var idiom: UIUserInterfaceIdiom { UIDevice.current.userInterfaceIdiom } + @State private var orientation = UIDevice.current.orientation + + @ObservedObject var contactsManager = ContactsManager.shared + @ObservedObject var magicSearch = MagicSearchSingleton.shared + @ObservedObject var scheduleMeetingViewModel: ScheduleMeetingViewModel + + @State private var delayedColor = Color.white + + @Binding var isShowAddParticipantFragment: Bool + @FocusState var isSearchFieldFocused: Bool + + var body: some View { + ZStack(alignment: .bottomTrailing) { + VStack(spacing: 16) { + if #available(iOS 16.0, *) { + Rectangle() + .foregroundColor(delayedColor) + .edgesIgnoringSafeArea(.top) + .frame(height: 0) + .task(delayColor) + } else if idiom != .pad && !(orientation == .landscapeLeft || orientation == .landscapeRight + || UIScreen.main.bounds.size.width > UIScreen.main.bounds.size.height) { + Rectangle() + .foregroundColor(delayedColor) + .edgesIgnoringSafeArea(.top) + .frame(height: 1) + .task(delayColor) + } + HStack { + Image("caret-left") + .renderingMode(.template) + .resizable() + .foregroundStyle(Color.orangeMain500) + .frame(width: 25, height: 25, alignment: .leading) + .padding(.all, 10) + .padding(.top, 2) + .padding(.leading, -10) + .onTapGesture { + isShowAddParticipantFragment = false + scheduleMeetingViewModel.participantsToAdd = [] + } + + VStack(alignment: .leading, spacing: 3) { + Text("Add participants") + .multilineTextAlignment(.leading) + .default_text_style_orange_800(styleSize: 16) + .padding(.top, 20) + Text("\($scheduleMeetingViewModel.participants.count) selected participants") + .default_text_style_300(styleSize: 12) + } + Spacer() + } + .frame(maxWidth: .infinity) + .frame(height: 50) + .padding(.horizontal) + .padding(.bottom, 4) + .background(.white) + + ForEach(0..