Skip to content

Commit

Permalink
chore: Change wording icon and add alignmentGuide
Browse files Browse the repository at this point in the history
  • Loading branch information
charlella committed Apr 29, 2024
1 parent b0f5ba7 commit 605a529
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion Mail/Views/Thread List/ThreadListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
10 changes: 5 additions & 5 deletions Mail/Views/Thread List/UpdateVersionAlertView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import InfomaniakCoreUI
import InfomaniakDI
import MailCore
import MailResources
import SwiftUI

struct UpdateVersionAlertView: View {
Expand All @@ -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)
}
Expand Down
40 changes: 24 additions & 16 deletions Mail/Views/Thread List/UpdateVersionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down
16 changes: 16 additions & 0 deletions MailResources/Assets.xcassets/warning-fill.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"filename" : "warning.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions MailResources/Assets.xcassets/warning.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
"preserves-vector-representation" : true
}
}
4 changes: 3 additions & 1 deletion MailResources/Assets.xcassets/warning.imageset/warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 605a529

Please sign in to comment.