diff --git a/.DS_Store b/.DS_Store index 8a76e60..cbcae65 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Neuro App/HomeView.swift b/Neuro App/HomeView.swift index ddc4db7..f70842d 100644 --- a/Neuro App/HomeView.swift +++ b/Neuro App/HomeView.swift @@ -14,7 +14,7 @@ struct HomeView: View { @EnvironmentObject var signalingClient: SignalingClient @StateObject private var formViewModel = StrokeScaleFormViewModel() - @State private var isSavedFormsPresented: Bool = false // State to control the modal presentation + @State private var isNavigatingToSavedForms = false // State variable to control navigation var body: some View { if signalingClient.isInCall { @@ -23,27 +23,41 @@ struct HomeView: View { NavigationView { VStack { + /* Can use when we implement login and replace 'user' with username Text("Hello, user!") .font(/*@START_MENU_TOKEN@*/.title/*@END_MENU_TOKEN@*/) .bold() .padding(10) .foregroundColor(Color.black) - + */ + Spacer() VStack(spacing: 10) { Text("Your Peer ID:") .font(.headline) .bold() .multilineTextAlignment(.center) - .foregroundColor(Color.black) + .foregroundColor( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .white : .black + }) + ) Text(signalingClient.ourPeerID) .font(.subheadline) .multilineTextAlignment(.center) - .foregroundColor(.black) + .foregroundColor( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .white : .black + }) + ) } .padding() .frame(maxWidth: .infinity) - .background(Color.white) + .background( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .black : .white + }) + ) .cornerRadius(10) .shadow(radius: 2) @@ -60,11 +74,19 @@ struct HomeView: View { Text("Hmm, nobody's here right now!") .padding() .frame(maxWidth: .infinity) - .background(Color.white) + .background( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .black : .white + }) + ) .cornerRadius(10) .shadow(radius: 2) .padding(.horizontal) - .foregroundColor(Color.black) + .foregroundColor( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .white : .black + }) + ) } else { VStack(spacing: 10) { ForEach(filteredOnlineUsers, id: \.self) { user in @@ -77,17 +99,36 @@ struct HomeView: View { Spacer() - NavigationLink(destination: SavedFormsView()) { - Text("NIH Forms") - .font(.headline) - .foregroundColor(.black) - .padding() - .frame(maxWidth: .infinity) - .background(Color.white) - .cornerRadius(10) - } - .padding(.horizontal) - .padding(.bottom, 20) + VStack { + Button(action: { + isNavigatingToSavedForms = true // Trigger navigation + }) { + Text("NIH Forms") + .font(.headline) + .foregroundColor( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .white : .black + }) + ) + .padding() + .frame(maxWidth: .infinity) + .background( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .black : .white + }) + ) + .cornerRadius(10) + } + .padding(.horizontal) + .padding(.bottom, 20) + .background( + NavigationLink( + destination: SavedFormsView(isNavigatingBack: $isNavigatingToSavedForms), + isActive: $isNavigatingToSavedForms, + label: { EmptyView() } + ) + ) + } } @@ -103,8 +144,18 @@ struct HomeView: View { .onAppear { signalingClient.fetchOnlineUsers() } - .background(Color(.lightGray)) + .background { + LinearGradient(colors: [.gray, .white, .gray], startPoint: .topLeading, endPoint: .bottomTrailing) + .edgesIgnoringSafeArea(.all) + .hueRotation(.degrees(45)) + .onAppear { + withAnimation( + .easeInOut(duration: 2) + .repeatForever(autoreverses: true)){} + } + } } + } } } @@ -118,7 +169,11 @@ struct OnlineUserCardView: View { .font(.subheadline) .padding(.vertical, 10) .padding(.leading, 15) - .foregroundColor(Color.black) + .foregroundColor( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .white : .black + }) + ) Spacer() @@ -127,18 +182,34 @@ struct OnlineUserCardView: View { }, label: { HStack { Image(systemName: "phone.fill") - .foregroundColor(.white) + .foregroundColor( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .black : .white + }) + ) Text("Call") - .foregroundColor(.white) + .foregroundColor( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .black : .white + }) + ) } .padding(10) - .background(Color.black) + .background( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .white : .black + }) + ) .cornerRadius(8) }) .padding(.trailing, 15) } .frame(maxWidth: .infinity) - .background(Color.white) + .background( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .black : .white + }) + ) .cornerRadius(10) .shadow(radius: 2) .padding(.horizontal) diff --git a/Neuro App/Neuro_AppApp.swift b/Neuro App/Neuro_AppApp.swift index 227fedf..c6410d0 100755 --- a/Neuro App/Neuro_AppApp.swift +++ b/Neuro App/Neuro_AppApp.swift @@ -15,8 +15,7 @@ struct Neuro_App: App { var body: some Scene { WindowGroup { - - HomeView() + HomeView() .environment(\.managedObjectContext, appDelegate.persistentContainer.viewContext) // Inject Core Data context .environmentObject(appDelegate.signalingClient) } diff --git a/Neuro App/NewNIHFormView.swift b/Neuro App/NewNIHFormView.swift new file mode 100644 index 0000000..9cb2929 --- /dev/null +++ b/Neuro App/NewNIHFormView.swift @@ -0,0 +1,101 @@ +import SwiftUI + +struct NewNIHFormView: View { + @Environment(\.managedObjectContext) private var viewContext + @StateObject private var viewModel = StrokeScaleFormViewModel() + @State private var patientName: String = "" + @Environment(\.presentationMode) var presentationMode + + var body: some View { + VStack { + Text("New NIH Stroke Scale Form") + .font(.title) + .padding(.leading) + .padding(.trailing) + .padding(.top) + .padding(.bottom, 5) + .bold() + + TextField("Enter Patient Name", text: $patientName) + .padding(.leading) + .padding(.trailing) + .padding(.bottom, 5) + .textFieldStyle(RoundedBorderTextFieldStyle()) + + Text("Date: \(Date(), style: .date)") + .padding(.bottom, 5) + + Form { + ForEach(viewModel.questions.indices, id: \.self) { index in + let question = viewModel.questions[index] + Section { + OptionRowView(question: question, selectedOption: $viewModel.questions[index].selectedOption) + } + } + } + + + // Save and Cancel buttons + HStack { + Button(action: { + saveForm() + presentationMode.wrappedValue.dismiss() // Dismiss after saving + }) { + Text("Save") + .font(.headline) + .foregroundColor(.white) + .padding() + .frame(maxWidth: .infinity) + .background(Color.green) + .cornerRadius(10) + } + + Button(action: { + presentationMode.wrappedValue.dismiss() // Dismiss without saving + }) { + Text("Cancel") + .font(.headline) + .foregroundColor(.white) + .padding() + .frame(maxWidth: .infinity) + .background(Color.red) + .cornerRadius(10) + } + } + .padding(.horizontal) + .padding(.bottom) + } + .background(Color.purple.opacity(0.2)) + } + + private func saveForm() { + // Get the Core Data context from the environment + let context = viewContext + + // Create a new NIHFormEntity + let newForm = NIHFormEntity(context: context) + newForm.date = Date() + newForm.patientName = patientName + + // Collect selected options from each question + let selectedOptions = viewModel.questions.map { $0.selectedOption ?? -1 } + + // Encode the array of selected options into data and save it in Core Data + do { + let optionsData = try JSONEncoder().encode(selectedOptions) + newForm.selectedOptions = optionsData as Data + + // Ensure the save operation happens on the main thread + DispatchQueue.main.async { + do { + try context.save() + print("Form saved successfully.") + } catch { + print("Failed to save form: \(error)") + } + } + } catch { + print("Failed to encode selected options: \(error)") + } + } +} diff --git a/Neuro App/SavedFormDetailView.swift b/Neuro App/SavedFormDetailView.swift index f83fe3a..b616eb6 100644 --- a/Neuro App/SavedFormDetailView.swift +++ b/Neuro App/SavedFormDetailView.swift @@ -7,73 +7,79 @@ struct SavedFormDetailView: View { var savedForm: NIHFormEntity @ObservedObject var viewModel = StrokeScaleFormViewModel() @State var selectedOptions: [Int] + @Environment(\.dismiss) private var dismiss // Dismiss environment variable var totalScore: Int { var score = 0 for (index, selectedOption) in selectedOptions.enumerated() where selectedOption != -1 { score += viewModel.questions[index].options[selectedOption].score } - return score } init(savedForm: NIHFormEntity) { self.savedForm = savedForm - - // Decode the selectedOptions from Core Data (if they exist) if let optionsData = savedForm.selectedOptions { do { let decodedOptions = try JSONDecoder().decode([Int].self, from: optionsData) self._selectedOptions = State(initialValue: decodedOptions) } catch { - self._selectedOptions = State(initialValue: Array(repeating: -1, count: 15)) // Default for 15 questions + self._selectedOptions = State(initialValue: Array(repeating: -1, count: 15)) print("Failed to decode options") } } else { - self._selectedOptions = State(initialValue: Array(repeating: -1, count: 15)) // Default for 15 questions + self._selectedOptions = State(initialValue: Array(repeating: -1, count: 15)) } } var body: some View { VStack { - Text("NIH Stroke Scale Form") - .font(.title) - - if let patientName = savedForm.patientName { - Text("Patient Name: \(patientName)") - .font(.headline) - } else { - Text("Patient Name: Unknown") - .font(.headline) + // Header Section + HStack { + Text("NIH Stroke Scale Form") + .font(.title) + .padding(.leading) + .padding(.trailing) .padding(.top) + .padding(.bottom, 5) + .bold() } - Text("Date: \(savedForm.date ?? Date(), style: .date)") - - // Display the total score below the date - Text("Total Score: \(totalScore)") - .padding(.bottom) + // Patient Info Section + VStack { + Text("Patient Name: \(savedForm.patientName ?? "Unknown")") + .font(.headline) + .padding(.bottom, 5) + .multilineTextAlignment(.center) + + Text(savedForm.date != nil + ? "Date: \(savedForm.date!, style: .date)" + : "Date: Unknown") + .font(.subheadline) + .padding(.bottom, 5) + .foregroundColor(.gray) + .multilineTextAlignment(.center) + } + .padding(.horizontal) + .frame(maxWidth: .infinity, alignment: .center) - ScrollView { - VStack(alignment: .leading) { - ForEach(viewModel.questions.indices, id: \.self) { index in - let question = viewModel.questions[index] - let selectedOptionIndex = selectedOptions[index] + // Questions and Answers Section + Form { + ForEach(viewModel.questions.indices, id: \.self) { index in + let question = viewModel.questions[index] + let selectedOptionIndex = selectedOptions[index] - Section { - // Question header + Section { + VStack(alignment: .leading, spacing: 10) { Text(question.questionHeader) .font(.headline) - .padding(.top, 5) - // Subheader if it exists if let subHeader = question.subHeader { Text(subHeader) .font(.subheadline) .foregroundColor(.gray) } - // Display the options (without editing capabilities) VStack(alignment: .leading) { ForEach(question.options.indices, id: \.self) { optionIndex in let option = question.options[optionIndex] @@ -81,61 +87,82 @@ struct SavedFormDetailView: View { Text(option.title) .padding(.vertical, 10) .padding(.leading) - .foregroundColor(.white) Spacer() - // Display the score for the selected option Text(option.score > 0 ? "+\(option.score)" : "\(option.score)") .foregroundColor(.gray) .frame(width: 40, alignment: .trailing) .padding(.trailing) } - .background(selectedOptionIndex == optionIndex ? Color.purple.opacity(0.6) : Color.purple.opacity(0.2)) + .background(selectedOptionIndex == optionIndex ? Color.purple.opacity(0.6) : Color.gray.opacity(0.2)) .cornerRadius(6) } } } - .padding(.bottom, 10) } } - .padding(.horizontal) } Spacer() - // Hides the navigation bar to prevent empty space and extra back button - .navigationBarBackButtonHidden(true) - // Export & Delete button + // Footer Section HStack { Button(action: { - exportFormAsPDF() // Call the PDF export function - }) { - Text("Export") + dismiss() + }, label: { + Text("Done") .font(.headline) .foregroundColor(.black) .padding() .frame(maxWidth: .infinity) .background(Color.white) .cornerRadius(10) - } - Button(action: { - deleteForm() - }) { - Text("Delete") - .font(.headline) - .foregroundColor(.white) - .padding() - .frame(maxWidth: .infinity) - .background(Color.red) - .cornerRadius(10) - } + }) + + Button(action: { + // Delete action + }, label: { + Text("Delete") + .font(.headline) + .foregroundColor(.white) + .padding() + .frame(maxWidth: .infinity) + .background(Color.red) + .cornerRadius(10) + }) } .padding(.horizontal) .padding(.bottom) } + .background(Color.purple.opacity(0.2)) } + private func deleteForm() { + guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { + print("Failed to access AppDelegate") // Log if AppDelegate isn't accessible + return + } + + let managedContext = appDelegate.persistentContainer.viewContext + + // Proceed with deletion + managedContext.delete(savedForm) + + do { + try managedContext.save() + print("Form deleted successfully") + } catch { + print("Failed to delete the form: \(error.localizedDescription)") + } + + // Optionally pop the view after deletion + if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, + let rootViewController = windowScene.windows.first?.rootViewController as? UINavigationController { + rootViewController.popViewController(animated: true) + } + } + private func exportFormAsPDF() { let pdfRenderer = UIGraphicsPDFRenderer(bounds: CGRect(x: 0, y: 0, width: 595, height: 842)) // A4 size PDF @@ -245,29 +272,4 @@ struct SavedFormDetailView: View { } } - private func deleteForm() { - guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { - print("Failed to access AppDelegate") // Log if AppDelegate isn't accessible - return - } - - let managedContext = appDelegate.persistentContainer.viewContext - - // Proceed with deletion - managedContext.delete(savedForm) - - do { - try managedContext.save() - print("Form deleted successfully") - } catch { - print("Failed to delete the form: \(error.localizedDescription)") - } - - // Optionally pop the view after deletion - if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, - let rootViewController = windowScene.windows.first?.rootViewController as? UINavigationController { - rootViewController.popViewController(animated: true) - } - } - } diff --git a/Neuro App/SavedFormsView.swift b/Neuro App/SavedFormsView.swift index 91415bb..2e701a0 100644 --- a/Neuro App/SavedFormsView.swift +++ b/Neuro App/SavedFormsView.swift @@ -8,45 +8,125 @@ struct SavedFormsView: View { entity: NIHFormEntity.entity(), sortDescriptors: [NSSortDescriptor(keyPath: \NIHFormEntity.date, ascending: false)] ) - private var savedForms: FetchedResults + @Binding var isNavigatingBack: Bool + @State private var isShowingNewFormView = false + @State private var selectedForm: NIHFormEntity? + @State private var isShowingDetailView = false + var body: some View { - // Ensure the view is inside a single NavigationView at the top level - NavigationView { - VStack { - List { - ForEach(savedForms, id: \.self) { form in - // Make the entire row clickable by using a NavigationLink - NavigationLink(destination: SavedFormDetailView(savedForm: form)) { + ZStack { + // Background gradient + LinearGradient(colors: [.gray, .white, .gray], startPoint: .topLeading, endPoint: .bottomTrailing) + .edgesIgnoringSafeArea(.all) + + ScrollView { + VStack(spacing: 20) { + // Header Section (now scrollable) + VStack { + HStack { + Button(action: { + isNavigatingBack = false + }) { + HStack { + Image(systemName: "chevron.left") + Text("Back") + } + .foregroundColor(.black) + .font(.title3) + } + + Spacer() + + Button(action: { + isShowingNewFormView = true + }) { + Text("New Form") + .foregroundColor(.black) + .font(.title3) + } + } + .padding(.horizontal) + .padding(.top) + + Text("Saved Forms") + .font(.largeTitle) + .bold() + .foregroundColor(.black) + .padding(.leading) + .padding(.top, 5) + .frame(maxWidth: .infinity, alignment: .leading) + } + + // List of Forms + VStack(spacing: 15) { + ForEach(savedForms, id: \.self) { form in HStack { - // Show the date as the title - Text(form.date ?? Date(), style: .date) + VStack(alignment: .leading, spacing: 5) { + Text(form.patientName ?? "Unnamed Patient") + .font(.headline) + .foregroundColor( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .white : .black + }) + ) + Text(form.date ?? Date(), style: .date) + .font(.subheadline) + .foregroundColor( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .white : .black + }) + ) + } + Spacer() + + Button(action: { + selectedForm = form + isShowingDetailView = true + }) { + HStack { + Text("View") + } + .font(.subheadline) + .foregroundColor(.black) + .padding(.vertical, 6) + .padding(.horizontal, 10) + .background(Color.white) + .cornerRadius(8) + .overlay( + RoundedRectangle(cornerRadius: 8) + .stroke(Color.gray, lineWidth: 1) + ) + } } .padding() + .background( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .black : .white + }) + ) + .cornerRadius(10) + .shadow(radius: 5) } } + .padding(.horizontal) + .padding(.bottom, 20) } } - .navigationTitle("Saved Forms") - .toolbar { - // Add a button in the top-right corner - ToolbarItem(placement: .navigationBarTrailing) { - Button(action: { - // Action for creating a new form - print("New Form button tapped") - // Insert your action to navigate to the new form creation view here - }) { - Text("New Form") - } + .navigationBarBackButtonHidden(true) // Hide the default back button + .fullScreenCover(isPresented: $isShowingNewFormView) { + NewNIHFormView() + } + .fullScreenCover(isPresented: $isShowingDetailView) { + if let form = selectedForm { + SavedFormDetailView(savedForm: form) } } .onAppear { - viewContext.refreshAllObjects() // Refresh to ensure the latest data + viewContext.refreshAllObjects() } } - // Force single-column navigation style - .navigationViewStyle(StackNavigationViewStyle()) } } diff --git a/Neuro App/SignInView.swift b/Neuro App/SignInView.swift index a72eb0e..cc1894e 100644 --- a/Neuro App/SignInView.swift +++ b/Neuro App/SignInView.swift @@ -13,91 +13,169 @@ struct SignInView: View { @State private var isPasswordVisible: Bool = false var body: some View { - GeometryReader { _ in - VStack(spacing: 30) { - Text("Hello, user!") - .font(.title) - .bold() - .padding(30) + GeometryReader { geometry in + ZStack { + // Background gradient + LinearGradient(colors: [.gray, .white, .gray], startPoint: .topLeading, endPoint: .bottomTrailing) + .edgesIgnoringSafeArea(.all) + .hueRotation(.degrees(45)) + .onAppear { + withAnimation( + .easeInOut(duration: 2) + .repeatForever(autoreverses: true)){} + } - VStack(alignment: .leading) { - Text("Username") - .font(.headline) - .padding(.top) - .padding(.leading) - .padding(.trailing) + // Centered Black Box + VStack(spacing: 20) { + // Left-aligned Title and Subtitle + VStack(alignment: .leading, spacing: 5) { + Text("Login") + .font(.largeTitle) + .bold() + .foregroundColor( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .white : .black + }) + ) + + Text("Enter your credentials to access your account") + .font(.subheadline) + .foregroundColor(.gray) + } + .frame(maxWidth: .infinity, alignment: .leading) + .padding(.horizontal) - TextField("Enter your username", text: $username) - .padding() - .background(Color(.systemGray6)) - .cornerRadius(5) - .autocapitalization(/*@START_MENU_TOKEN@*/.none/*@END_MENU_TOKEN@*/) - .disableAutocorrection(true) - .padding(.leading) - .padding(.trailing) - .padding(.bottom) + VStack(alignment: .leading, spacing: 15) { + // Username Field + Text("Username") + .font(.headline) + .foregroundColor( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .white : .black + }) + ) - HStack { + TextField("Enter your username", text: $username) + .padding(10) + .cornerRadius(5) + .overlay( + RoundedRectangle(cornerRadius: 5) + .stroke(Color.gray, lineWidth: 1) + ) + .autocapitalization(.none) + .disableAutocorrection(true) + + // Password Field Text("Password") .font(.headline) - .padding(.top) - .padding(.leading) - .padding(.trailing) + .foregroundColor( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .white : .black + }) + ) - Button(action: { - isPasswordVisible.toggle() - }, label: { - Image(systemName: isPasswordVisible ? "eye.fill" : "eye.slash.fill") - .foregroundColor(.gray) - }) - .padding(.bottom, -13) - .padding(.leading, -5) - } + ZStack(alignment: .trailing) { + if isPasswordVisible { + TextField("Enter your password", text: $password) + .padding(10) + .cornerRadius(5) + .overlay( + RoundedRectangle(cornerRadius: 5) + .stroke(Color.gray, lineWidth: 1) + ) + .autocapitalization(.none) + .disableAutocorrection(true) + } else { + SecureField("Enter your password", text: $password) + .padding(10) + .cornerRadius(5) + .overlay( + RoundedRectangle(cornerRadius: 5) + .stroke(Color.gray, lineWidth: 1) + ) + .autocapitalization(.none) + .disableAutocorrection(true) + } - HStack { - if isPasswordVisible { - TextField("Enter your password", text: $password) - .padding() - .background(Color(.systemGray6)) - .cornerRadius(5) - .autocapitalization(/*@START_MENU_TOKEN@*/.none/*@END_MENU_TOKEN@*/) - .disableAutocorrection(true) - .padding(.leading) - .padding(.trailing) - .padding(.bottom) - } else { - SecureField("Enter your password", text: $password) - .padding() - .background(Color(.systemGray6)) - .cornerRadius(5) - .autocapitalization(/*@START_MENU_TOKEN@*/.none/*@END_MENU_TOKEN@*/) - .disableAutocorrection(true) - .padding(.leading) - .padding(.trailing) - .padding(.bottom) + Button(action: { + isPasswordVisible.toggle() + }, label: { + Image(systemName: isPasswordVisible ? "eye.fill" : "eye.slash.fill") + .foregroundColor(.gray) + }) + .padding(.trailing, 15) // Position inside the gray box } - } + .padding(.horizontal) + .padding(.bottom) + + // Sign In Button with Outline + Button(action: { + // Add sign-in functionality here + }, label: { + Text("Sign In") + .bold() + .foregroundColor( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .white : .black + }) + ) + .padding(10) + .frame(maxWidth: .infinity) + .background( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .black : .white + }) + ) + .cornerRadius(10) + .overlay( + RoundedRectangle(cornerRadius: 10) + .stroke(Color.gray, lineWidth: 1) // Outline + ) + }) + .frame(maxWidth: geometry.size.width * 0.9) // Matches input field width + .padding(.horizontal) + // Sign Up Button with Outline + Button(action: { + // Add sign-up functionality here + }, label: { + Text("Create Account") + .bold() + .foregroundColor( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .white : .black + }) + ) + .padding(10) + .frame(maxWidth: .infinity) + .background( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .black : .white + }) + ) + .cornerRadius(10) + .overlay( + RoundedRectangle(cornerRadius: 10) + .stroke(Color.gray, lineWidth: 1) // Outline + ) + }) + .frame(maxWidth: geometry.size.width * 0.9) // Matches input field width + .padding(.horizontal) } - - Button(action: { - // add sign in functionality here - }, label: { - Text("Sign In") - .foregroundColor(.black) - .padding() - .frame(maxWidth: .infinity) - .background(Color.yellow) - .cornerRadius(20) - }) - .padding(20) + .padding() + .padding(.bottom, 15) + .frame(width: geometry.size.width * 0.9) + .background( + Color(UIColor { traitCollection in + return traitCollection.userInterfaceStyle == .dark ? .black : .white + }) + ) + .cornerRadius(15) + .shadow(radius: 10) } - } - } - } #Preview { diff --git a/Neuro App/StrokeScaleFormView.swift b/Neuro App/StrokeScaleFormView.swift index 4d617f8..7f8f961 100644 --- a/Neuro App/StrokeScaleFormView.swift +++ b/Neuro App/StrokeScaleFormView.swift @@ -127,7 +127,6 @@ struct OptionRowView: View { Text(option.title) .padding(.vertical, 10) .padding(.leading) - .foregroundColor(.white) Spacer() diff --git a/Neurology-iOS-Client-App.xcodeproj/project.pbxproj b/Neurology-iOS-Client-App.xcodeproj/project.pbxproj index 852bd42..1e858a0 100644 --- a/Neurology-iOS-Client-App.xcodeproj/project.pbxproj +++ b/Neurology-iOS-Client-App.xcodeproj/project.pbxproj @@ -31,6 +31,7 @@ 60140A712CAEE2F400E61908 /* SavedFormDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60140A702CAEE2F400E61908 /* SavedFormDetailView.swift */; }; 60B7690B2C9B818C00CC8343 /* StrokeScaleFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60B7690A2C9B818100CC8343 /* StrokeScaleFormView.swift */; }; 60B7690F2CA32CE000CC8343 /* SavedFormsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60B7690E2CA32CD500CC8343 /* SavedFormsView.swift */; }; + D4F7ECA02D03989400C356C8 /* NewNIHFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4F7EC9F2D03988B00C356C8 /* NewNIHFormView.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -82,6 +83,7 @@ 60B7690E2CA32CD500CC8343 /* SavedFormsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SavedFormsView.swift; sourceTree = ""; }; 60E860F62C5192DE0097826E /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = ""; }; 60F68C252C5ABB3D00933EE3 /* CallView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallView.swift; sourceTree = ""; }; + D4F7EC9F2D03988B00C356C8 /* NewNIHFormView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewNIHFormView.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -120,6 +122,7 @@ 60B7690A2C9B818100CC8343 /* StrokeScaleFormView.swift */, 60E860F62C5192DE0097826E /* HomeView.swift */, 60140A702CAEE2F400E61908 /* SavedFormDetailView.swift */, + D4F7EC9F2D03988B00C356C8 /* NewNIHFormView.swift */, 08EEC3232C5BF9E70086C228 /* Config.swift */, 60F68C252C5ABB3D00933EE3 /* CallView.swift */, 60B7690E2CA32CD500CC8343 /* SavedFormsView.swift */, @@ -335,6 +338,7 @@ 08E4E3B72C7E50DC0043D541 /* RTCVideoWrapper.swift in Sources */, 080411D92C6BB1C60019364A /* PushNotificationManager.swift in Sources */, 0813C0AF2C61538700CF5C70 /* CallView.swift in Sources */, + D4F7ECA02D03989400C356C8 /* NewNIHFormView.swift in Sources */, 60B7690B2C9B818C00CC8343 /* StrokeScaleFormView.swift in Sources */, 0813C0B02C61539200CF5C70 /* HomeView.swift in Sources */, 0813C0B62C6159A200CF5C70 /* SignalingClient.swift in Sources */,