From e0190cf3bb923ae1fb460510572ce86caacde5ca Mon Sep 17 00:00:00 2001 From: RSA Date: Tue, 15 Sep 2026 15:41:20 +0100 Subject: [PATCH] loginview --- medmap.xcodeproj/project.pbxproj | 2 + medmap/ViewModels/DashboardViewModel.swift | 3 +- medmap/ViewModels/LoginViewModel.swift | 5 ++- medmap/Views/LoginView.swift | 44 ++++++++-------------- 4 files changed, 23 insertions(+), 31 deletions(-) diff --git a/medmap.xcodeproj/project.pbxproj b/medmap.xcodeproj/project.pbxproj index 96eea81..9360a08 100644 --- a/medmap.xcodeproj/project.pbxproj +++ b/medmap.xcodeproj/project.pbxproj @@ -422,6 +422,7 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -454,6 +455,7 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/medmap/ViewModels/DashboardViewModel.swift b/medmap/ViewModels/DashboardViewModel.swift index 148c37c..0415e18 100644 --- a/medmap/ViewModels/DashboardViewModel.swift +++ b/medmap/ViewModels/DashboardViewModel.swift @@ -1,5 +1,6 @@ import Foundation - +import SwiftUI +import Combine @MainActor final class DashboardViewModel: ViewModel { diff --git a/medmap/ViewModels/LoginViewModel.swift b/medmap/ViewModels/LoginViewModel.swift index da88cf8..a79a10e 100644 --- a/medmap/ViewModels/LoginViewModel.swift +++ b/medmap/ViewModels/LoginViewModel.swift @@ -4,7 +4,8 @@ // import Foundation - +import SwiftUI +import Combine @MainActor final class LoginViewModel: ViewModel { @@ -49,4 +50,4 @@ final class LoginViewModel: ViewModel { fluxlog("Patient login failed: \(error.localizedDescription)") } } -} \ No newline at end of file +} diff --git a/medmap/Views/LoginView.swift b/medmap/Views/LoginView.swift index 927c07b..2c21dc8 100644 --- a/medmap/Views/LoginView.swift +++ b/medmap/Views/LoginView.swift @@ -18,30 +18,19 @@ struct LoginView: View { var body: some View { ZStack { Color.appBackground.ignoresSafeArea() - - GeometryReader { geometry in - let usesTwoColumns = geometry.size.width > 700 - - Group { - if usesTwoColumns { - HStack(spacing: 0) { - brandPanel - .frame(width: geometry.size.width * 0.44) - formPanel - .frame(maxWidth: .infinity, maxHeight: .infinity) - } - } else { - formPanel - } - } - } + + + formPanel + + + } - .preferredColorScheme(.light) + //.preferredColorScheme(.light) } private var brandPanel: some View { ZStack(alignment: .bottomLeading) { - Color(hex: "#315F98") + Color.appBackground.ignoresSafeArea() Image("splashImage") .resizable() @@ -71,6 +60,8 @@ struct LoginView: View { private var formPanel: some View { VStack(spacing: 0) { + + Spacer(minLength: 32) VStack(alignment: .leading, spacing: 28) { @@ -86,10 +77,7 @@ struct LoginView: View { Text("Bem-vindo de volta") .font(.jakartaBold24) .foregroundStyle(Color.appTextPrimary) - Text("Entre na sua conta de doente para consultar o seu plano de medicacao.") - .font(.jakartaRegular16) - .foregroundStyle(Color.appTextPrimary.opacity(0.68)) - .fixedSize(horizontal: false, vertical: true) + } VStack(spacing: 18) { @@ -132,14 +120,14 @@ struct LoginView: View { .frame(maxWidth: .infinity) .frame(height: 52) } - .foregroundStyle(.white) - .background(Color.appBackground) + + .clipShape(RoundedRectangle(cornerRadius: 8)) .disabled(!viewModel.canSubmit) .opacity(viewModel.canSubmit ? 1 : 0.55) .accessibilityHint("Inicia sessao na conta de doente") } - .frame(maxWidth: 430) + .padding(.horizontal, 32) Spacer() @@ -149,7 +137,7 @@ struct LoginView: View { .foregroundStyle(Color.appTextPrimary.opacity(0.45)) .padding(.bottom, 24) } - .background(Color.white) + } private var passwordField: some View { @@ -226,4 +214,4 @@ struct LoginView: View { #Preview { LoginView() -} \ No newline at end of file +}