From 605a52917cb3c97ecb83f67ba20e725abb0025d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charle=CC=80ne=20Hoareau?= Date: Mon, 29 Apr 2024 16:21:47 +0200 Subject: [PATCH] chore: Change wording icon and add alignmentGuide --- .../Proposition/AIDismissibleErrorView.swift | 2 +- .../MailboxesManagementButtonView.swift | 2 +- Mail/Views/Thread List/ThreadListView.swift | 2 +- .../Thread List/UpdateVersionAlertView.swift | 10 ++--- .../Views/Thread List/UpdateVersionView.swift | 40 +++++++++++-------- .../Calendar/CalendarBodyDetailsView.swift | 2 +- .../warning-fill.imageset/Contents.json | 16 ++++++++ .../warning-fill.imageset/warning.svg | 3 ++ .../warning.imageset/Contents.json | 3 +- .../warning.imageset/warning.svg | 4 +- 10 files changed, 56 insertions(+), 28 deletions(-) create mode 100644 MailResources/Assets.xcassets/warning-fill.imageset/Contents.json create mode 100644 MailResources/Assets.xcassets/warning-fill.imageset/warning.svg diff --git a/Mail/Views/AI Writer/Proposition/AIDismissibleErrorView.swift b/Mail/Views/AI Writer/Proposition/AIDismissibleErrorView.swift index ff1ea43c3b..905cd2d8c6 100644 --- a/Mail/Views/AI Writer/Proposition/AIDismissibleErrorView.swift +++ b/Mail/Views/AI Writer/Proposition/AIDismissibleErrorView.swift @@ -34,7 +34,7 @@ struct AIDismissibleErrorView: View { Group { if isShowingError { InformationBlockView( - icon: MailResourcesAsset.warning.swiftUIImage, + icon: MailResourcesAsset.warningFill.swiftUIImage, message: error?.localizedDescription ?? "", iconColor: MailResourcesAsset.orangeColor.swiftUIColor ) { diff --git a/Mail/Views/Menu Drawer/MailboxManagement/MailboxesManagementButtonView.swift b/Mail/Views/Menu Drawer/MailboxManagement/MailboxesManagementButtonView.swift index 02e73997d0..7d6578e2f2 100644 --- a/Mail/Views/Menu Drawer/MailboxManagement/MailboxesManagementButtonView.swift +++ b/Mail/Views/Menu Drawer/MailboxManagement/MailboxesManagementButtonView.swift @@ -62,7 +62,7 @@ struct MailboxesManagementButtonView: View { .frame(maxWidth: .infinity, alignment: .leading) if !mailbox.isAvailable && style != .blockedPassword && style != .locked { - MailResourcesAsset.warning.swiftUIImage + MailResourcesAsset.warningFill.swiftUIImage .foregroundStyle(MailResourcesAsset.orangeColor.swiftUIColor) } else { switch style { diff --git a/Mail/Views/Thread List/ThreadListView.swift b/Mail/Views/Thread List/ThreadListView.swift index fd16b9a234..96cefe7247 100644 --- a/Mail/Views/Thread List/ThreadListView.swift +++ b/Mail/Views/Thread List/ThreadListView.swift @@ -61,7 +61,7 @@ struct ThreadListView: View { private var shouldDisplayUpdateOSView: Bool { guard !updateOSViewDismissed && !platformDetector.isMac else { return false } if #available(iOS 16.5, *) { - return true // après DEBUG: remettre à false + return true // après DEBUG: remettre à false } else { return true } diff --git a/Mail/Views/Thread List/UpdateVersionAlertView.swift b/Mail/Views/Thread List/UpdateVersionAlertView.swift index da895e8609..8294d17854 100644 --- a/Mail/Views/Thread List/UpdateVersionAlertView.swift +++ b/Mail/Views/Thread List/UpdateVersionAlertView.swift @@ -18,6 +18,7 @@ import InfomaniakCoreUI import InfomaniakDI import MailCore +import MailResources import SwiftUI struct UpdateVersionAlertView: View { @@ -30,14 +31,13 @@ struct UpdateVersionAlertView: View { var body: some View { VStack(alignment: .leading, spacing: UIPadding.medium) { - Text("Vos e-mails peuvent ne pas s’afficher correctement ") + Text("Votre expérience peut être dégradée car votre appareil n’est pas à jour") .textStyle(.bodyMedium) - Text("Pour une expérience optimale, veuillez mettre à jour votre appareil.") + Text("Pour votre sécurité et améliorer votre expérience, veuillez mettre à jour votre appareil.") .textStyle(.body) - ModalButtonsView(primaryButtonTitle: "Mettre à jour", - // MailResourcesStrings.Localizable.buttonUpdateOSVersion, - secondaryButtonTitle: "Plus tard", + ModalButtonsView(primaryButtonTitle: MailResourcesStrings.Localizable.buttonUpdate, + secondaryButtonTitle: MailResourcesStrings.Localizable.buttonLater, primaryButtonAction: updateVersion, secondaryButtonAction: dismissUpdateVersionView) } diff --git a/Mail/Views/Thread List/UpdateVersionView.swift b/Mail/Views/Thread List/UpdateVersionView.swift index 8232d5018c..a07b45829e 100644 --- a/Mail/Views/Thread List/UpdateVersionView.swift +++ b/Mail/Views/Thread List/UpdateVersionView.swift @@ -24,33 +24,41 @@ import SwiftUI struct UpdateVersionView: View { @State private var isShowingUpdateAlert = false -// @Binding var isShowingUpdateVersionView: Bool var body: some View { VStack(alignment: .leading, spacing: UIPadding.small) { - VStack(alignment: .leading, spacing: UIPadding.small) { - HStack(alignment: .center, spacing: UIPadding.small) { - IKIcon(MailResourcesAsset.warning) - .foregroundStyle(MailResourcesAsset.orangeColor) + HStack(alignment: .informationBlockAlignment, spacing: UIPadding.small) { + IKIcon(MailResourcesAsset.warning) + .foregroundStyle(MailResourcesAsset.orangeColor) + .alignmentGuide(.informationBlockAlignment) { d in + // Center of the view is on the informationBlockAlignment guide + d[VerticalAlignment.center] + } + + VStack(alignment: .leading, spacing: UIPadding.small) { Text("Vos e-mails peuvent ne pas s’afficher correctement.") .textStyle(.bodySmall) - } - - Button { - // matomo.track(eventWithCategory: .threadList, name: "") - isShowingUpdateAlert = true + .alignmentGuide(.informationBlockAlignment) { d in + // Center of the first line is on the informationBlockAlignment guide + (d.height - (d[.lastTextBaseline] - d[.firstTextBaseline])) / 2 + } - } label: { - HStack(spacing: UIPadding.small) { - Text("En savoir plus") - .textStyle(.bodySmallAccent) + Button { + // matomo.track(eventWithCategory: .threadList, name: "") + isShowingUpdateAlert = true + } label: { + HStack(spacing: UIPadding.small) { + Text("En savoir plus") + .textStyle(.bodySmallAccent) + } + .buttonStyle(.borderless) } - .buttonStyle(.borderless) } + .frame(maxWidth: .infinity, alignment: .leading) } .padding(.top, value: .regular) - .padding(.bottom, value: .small) .padding(.horizontal, value: .regular) + .frame(maxWidth: .infinity, alignment: .leading) IKDivider(type: .full) } diff --git a/Mail/Views/Thread/Message/Calendar/CalendarBodyDetailsView.swift b/Mail/Views/Thread/Message/Calendar/CalendarBodyDetailsView.swift index 8defb66034..0e2a2ce2e4 100644 --- a/Mail/Views/Thread/Message/Calendar/CalendarBodyDetailsView.swift +++ b/Mail/Views/Thread/Message/Calendar/CalendarBodyDetailsView.swift @@ -64,7 +64,7 @@ struct CalendarBodyDetailsView: View { var body: some View { VStack(alignment: .leading, spacing: UIPadding.regular) { if let warning = event.warning { - Label { Text(warning.label) } icon: { IKIcon(MailResourcesAsset.warning, size: .large) } + Label { Text(warning.label) } icon: { IKIcon(MailResourcesAsset.warningFill, size: .large) } .labelStyle(.calendar(warning)) } diff --git a/MailResources/Assets.xcassets/warning-fill.imageset/Contents.json b/MailResources/Assets.xcassets/warning-fill.imageset/Contents.json new file mode 100644 index 0000000000..968c3bd132 --- /dev/null +++ b/MailResources/Assets.xcassets/warning-fill.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "filename" : "warning.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" + } +} diff --git a/MailResources/Assets.xcassets/warning-fill.imageset/warning.svg b/MailResources/Assets.xcassets/warning-fill.imageset/warning.svg new file mode 100644 index 0000000000..81309f4b51 --- /dev/null +++ b/MailResources/Assets.xcassets/warning-fill.imageset/warning.svg @@ -0,0 +1,3 @@ + + + diff --git a/MailResources/Assets.xcassets/warning.imageset/Contents.json b/MailResources/Assets.xcassets/warning.imageset/Contents.json index 968c3bd132..86da0a6d6a 100644 --- a/MailResources/Assets.xcassets/warning.imageset/Contents.json +++ b/MailResources/Assets.xcassets/warning.imageset/Contents.json @@ -10,7 +10,6 @@ "version" : 1 }, "properties" : { - "preserves-vector-representation" : true, - "template-rendering-intent" : "template" + "preserves-vector-representation" : true } } diff --git a/MailResources/Assets.xcassets/warning.imageset/warning.svg b/MailResources/Assets.xcassets/warning.imageset/warning.svg index 81309f4b51..05f09edff0 100644 --- a/MailResources/Assets.xcassets/warning.imageset/warning.svg +++ b/MailResources/Assets.xcassets/warning.imageset/warning.svg @@ -1,3 +1,5 @@ - + + +