From a32fd1a16fe989e817ac3d5f6591a026de407b41 Mon Sep 17 00:00:00 2001 From: Rasmus Tauts Date: Thu, 14 Sep 2023 09:55:42 +0300 Subject: [PATCH] fixup! Convert ConfirmationView form UIKit to SwiftUI This PR is experimental, yet important first step towards transitioning to SwiftUI. ConfirmationView has been rewritten entirely in SwiftUI. The primary motivator for this PR was the frustrating nature of UIKit constraints. Key factors to keep in mind while reviewing: 1. Checkmark image has been made smaller, which was the request from the design team 2. UIFont does not translate 1:1 to SwiftUI Font, meaning the same font looks just a little big different now. But dynamic scaling works, and all our default fonts translate to expected outcome (font size, weight etc.) 3. Some approaches used in view layouts is due to the restrictions of SwiftUI 1.0 capabilities. Those can and will be upgraded in the future 4. The naming of Views, and Objects, as well as file locations in the directory are up for discussion. Everyone's input is much appreciated. 5. Prefix SwiftUI is used in lots of places due to a conflict with existing custom objects Button and Image 6. New HeaderSwiftUI view does not include all the possible configuration possibilities, as confirmations view's needs are not very demanding. So, that view can be upgraded in future. This PR also covers the ticket MOB-2488 which focuses on ADA-compliance in ConfigurationsView --- .../Confirmation/SecureConversations.ConfirmationView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/GliaWidgets/SecureConversations/Confirmation/SecureConversations.ConfirmationView.swift b/GliaWidgets/SecureConversations/Confirmation/SecureConversations.ConfirmationView.swift index 8f0e28f5d..1c6cca60a 100644 --- a/GliaWidgets/SecureConversations/Confirmation/SecureConversations.ConfirmationView.swift +++ b/GliaWidgets/SecureConversations/Confirmation/SecureConversations.ConfirmationView.swift @@ -81,6 +81,7 @@ private extension SecureConversations.ConfirmationViewSwiftUI { func confirmationButtonView() -> some View { Text(props.style.checkMessagesButtonStyle.title) .font(.convert(props.style.checkMessagesButtonStyle.font)) + .multilineTextAlignment(.center) .foregroundColor(SwiftUI.Color(props.style.checkMessagesButtonStyle.textColor)) .padding(.vertical, 8) .padding(.horizontal, 16)