From bbb79c25e219ade94e6ce157e84eb1bd21a7a3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Ara=C3=BAjo?= Date: Tue, 15 Sep 2026 15:53:31 +0100 Subject: [PATCH] login fix --- medmap/Views/LoginView.swift | 85 ++++++++++-------------------------- 1 file changed, 22 insertions(+), 63 deletions(-) diff --git a/medmap/Views/LoginView.swift b/medmap/Views/LoginView.swift index e5dae36..cc32f98 100644 --- a/medmap/Views/LoginView.swift +++ b/medmap/Views/LoginView.swift @@ -18,67 +18,27 @@ struct LoginView: View { var body: some View { ZStack { Color.appBackground.ignoresSafeArea() - - - + formPanel - - - } //.preferredColorScheme(.light) } - private var brandPanel: some View { - ZStack(alignment: .bottomLeading) { - Color.appBackground.ignoresSafeArea() - - Image("splashImage") - .resizable() - .scaledToFit() - .frame(maxWidth: 360) - .padding(40) - .accessibilityHidden(true) - - VStack(alignment: .leading, spacing: 10) { - Image("splashLogo") - .resizable() - .scaledToFit() - .frame(width: 146, height: 96) - .accessibilityHidden(true) - Text("MedMap") - .font(.jakartaBold24) - .foregroundStyle(.white) - Text("Acompanhamento simples da sua medicacao.") - .font(.jakartaRegular16) - .foregroundStyle(.white.opacity(0.84)) - .fixedSize(horizontal: false, vertical: true) - } - .padding(44) - } - .ignoresSafeArea() - } - private var formPanel: some View { VStack(spacing: 0) { + Image("splashLogo") + .resizable() + .scaledToFit() + .frame(width: 120, height: 76) + .accessibilityHidden(true) + .padding(.top, 32) - + Spacer() VStack(alignment: .leading, spacing: 24) { - VStack(alignment: .leading, spacing: 10) { - if UIDevice.current.userInterfaceIdiom == .phone { - Image("splashLogo") - .resizable() - .scaledToFit() - .frame(width: 120, height: 76) - .accessibilityHidden(true) - Spacer() - } - - Text("Aceda aqui à sua conta") - .font(.jakartaBold24) - .foregroundStyle(.white) - } + Text("Aceda aqui à sua conta") + .font(.jakartaBold24) + .foregroundStyle(.white) VStack(spacing: 14) { loginField( @@ -102,8 +62,7 @@ struct LoginView: View { .fixedSize(horizontal: false, vertical: true) .accessibilityLabel("Erro de autenticacao: \(errorMessage)") } - Spacer() - Spacer() + Button { focusedField = nil Task { @@ -128,21 +87,21 @@ struct LoginView: View { .disabled(!viewModel.canSubmit) .opacity(viewModel.canSubmit ? 1 : 0.55) .accessibilityHint("Inicia sessao na conta de doente") - Spacer() - Text("Não tem conta? Criar conta") - .font(.jakartaRegular14) - .foregroundStyle(.white.opacity(0.88)) - .frame(maxWidth: .infinity) - .multilineTextAlignment(.center) } .padding(.horizontal, 32) Spacer() - Text("MedMap") - .font(.jakartaRegular12) - .foregroundStyle(.white.opacity(0.6)) - .padding(.bottom, 24) + VStack(spacing: 8) { + Text("Não tem conta? Criar conta") + .font(.jakartaRegular14) + .foregroundStyle(.white.opacity(0.88)) + + Text("MedMap") + .font(.jakartaRegular12) + .foregroundStyle(.white.opacity(0.6)) + } + .padding(.bottom, 24) } }