diff --git a/Mail/Views/Onboarding/OnboardingView.swift b/Mail/Views/Onboarding/OnboardingView.swift
index a86071cd8..5c6bff498 100644
--- a/Mail/Views/Onboarding/OnboardingView.swift
+++ b/Mail/Views/Onboarding/OnboardingView.swift
@@ -93,6 +93,7 @@ final class LoginHandler: InfomaniakLoginDelegate, ObservableObject {
func loginAfterAccountCreation(from viewController: UIViewController) {
isLoading = true
+ matomo.track(eventWithCategory: .account, name: "openCreationWebview")
loginService.setupWebviewNavbar(
title: MailResourcesStrings.Localizable.buttonLogin,
titleColor: nil,
@@ -172,80 +173,79 @@ struct OnboardingView: View {
}
var body: some View {
- NavigationView {
- VStack(spacing: 0) {
- Group {
- if !isScrollEnabled,
- let slide = slides.first(where: { $0.id == selection }) {
- SlideView(slide: slide, updateAnimationColors: updateAnimationColors)
- } else {
- TabView(selection: $selection) {
- ForEach(slides) { slide in
- SlideView(slide: slide, updateAnimationColors: updateAnimationColors)
- .tag(slide.id)
- }
+ VStack(spacing: 0) {
+ Group {
+ if !isScrollEnabled,
+ let slide = slides.first(where: { $0.id == selection }) {
+ SlideView(slide: slide, updateAnimationColors: updateAnimationColors)
+ } else {
+ TabView(selection: $selection) {
+ ForEach(slides) { slide in
+ SlideView(slide: slide, updateAnimationColors: updateAnimationColors)
+ .tag(slide.id)
}
- .tabViewStyle(.page)
- .ignoresSafeArea(edges: .top)
}
+ .tabViewStyle(.page)
+ .ignoresSafeArea(edges: .top)
}
- .overlay(alignment: .top) {
- MailResourcesAsset.logoText.swiftUIImage
- .resizable()
- .scaledToFit()
- .frame(height: UIConstants.onboardingLogoHeight)
- .padding(.top, UIConstants.onboardingLogoPaddingTop)
- }
+ }
+ .overlay(alignment: .top) {
+ MailResourcesAsset.logoText.swiftUIImage
+ .resizable()
+ .scaledToFit()
+ .frame(height: UIConstants.onboardingLogoHeight)
+ .padding(.top, UIConstants.onboardingLogoPaddingTop)
+ }
- VStack(spacing: 24) {
- if selection == slides.count {
- MailButton(label: MailResourcesStrings.Localizable.buttonLogin) {
- loginHandler.login()
- }
- .mailButtonFullWidth(true)
- .mailButtonLoading(loginHandler.isLoading)
-
- NavigationLink(isActive: $isPresentingCreateAccount) {
- CreateAccountView()
- } label: {
- MailButton(label: MailResourcesStrings.Localizable.buttonCreateAccount) {
- isPresentingCreateAccount = true
- }
- .mailButtonStyle(.link)
- .disabled(false)
- }
- } else {
- MailButton(icon: MailResourcesAsset.fullArrowRight) {
- withAnimation {
- selection += 1
- }
+ VStack(spacing: 24) {
+ if selection == slides.count {
+ MailButton(label: MailResourcesStrings.Localizable.buttonLogin) {
+ loginHandler.login()
+ }
+ .mailButtonFullWidth(true)
+ .mailButtonLoading(loginHandler.isLoading)
+
+ MailButton(label: MailResourcesStrings.Localizable.buttonCreateAccount) {
+ isPresentingCreateAccount.toggle()
+ }
+ .mailButtonStyle(.link)
+ .disabled(loginHandler.isLoading)
+ } else {
+ MailButton(icon: MailResourcesAsset.fullArrowRight) {
+ withAnimation {
+ selection += 1
}
- .mailButtonIconSize(UIConstants.onboardingArrowIconSize)
}
+ .mailButtonIconSize(UIConstants.onboardingArrowIconSize)
}
- .frame(height: UIConstants.onboardingButtonHeight + UIConstants.onboardingBottomButtonPadding, alignment: .top)
- .padding(.horizontal, 24)
}
- .overlay(alignment: .topLeading) {
- if !isScrollEnabled {
- Button {
- dismiss()
- } label: {
- Image(systemName: "xmark")
- .resizable()
- }
- .frame(width: 24, height: 24)
- .padding(.top, 16)
- .padding(.leading, 24)
+ .frame(height: UIConstants.onboardingButtonHeight + UIConstants.onboardingBottomButtonPadding, alignment: .top)
+ .padding(.horizontal, 24)
+ }
+ .overlay(alignment: .topLeading) {
+ if !isScrollEnabled {
+ Button {
+ dismiss()
+ } label: {
+ Image(systemName: "xmark")
+ .resizable()
}
+ .frame(width: 24, height: 24)
+ .padding(.top, 16)
+ .padding(.leading, 24)
}
- .navigationBarTitle("")
}
.alert(MailResourcesStrings.Localizable.errorLoginTitle, isPresented: $loginHandler.isPresentingErrorAlert) {
// Use default button
} message: {
Text(MailResourcesStrings.Localizable.errorLoginDescription)
}
+ .sheet(isPresented: $isPresentingCreateAccount) {
+ RegisterView(registrationProcess: .mail) { viewController in
+ guard let viewController else { return }
+ loginHandler.loginAfterAccountCreation(from: viewController)
+ }
+ }
.onAppear {
if UIDevice.current.userInterfaceIdiom == .phone {
UIDevice.current
@@ -259,7 +259,6 @@ struct OnboardingView: View {
navigationState.transitionToRootViewDestination(.noMailboxes)
}
}
- .matomoView(view: [MatomoUtils.View.onboarding.displayName, "Main"])
}
// MARK: - Private methods
diff --git a/Mail/Views/Switch User/CreateAccountView.swift b/Mail/Views/Switch User/CreateAccountView.swift
deleted file mode 100644
index a16df48ba..000000000
--- a/Mail/Views/Switch User/CreateAccountView.swift
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- Infomaniak Mail - iOS App
- Copyright (C) 2022 Infomaniak Network SA
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import InfomaniakCoreUI
-import InfomaniakCreateAccount
-import InfomaniakDI
-import InfomaniakLogin
-import MailCore
-import MailResources
-import SwiftUI
-
-struct CreateAccountView: View {
- @AppStorage(UserDefaults.shared.key(.accentColor)) private var accentColor = DefaultPreferences.accentColor
-
- @State private var isPresentingCreateAccount = false
- @StateObject private var loginHandler = LoginHandler()
-
- var body: some View {
- VStack(spacing: 0) {
- accentColor.createAccountImage.swiftUIImage
- .resizable()
- .scaledToFit()
- .padding(.top, 24)
- .padding(.bottom, 48)
-
- Text(MailResourcesStrings.Localizable.newAccountTitle)
- .textStyle(.header1)
- .multilineTextAlignment(.center)
- .padding(.bottom, 24)
-
- HStack {
- Text(MailResourcesStrings.Localizable.newAccountStorageMail)
- .textStyle(.labelMediumAccent)
- .frame(maxWidth: .infinity, maxHeight: .infinity)
- .padding(8)
- .background(accentColor.secondary.swiftUIColor)
- .clipShape(Capsule())
- .multilineTextAlignment(.center)
- Text(MailResourcesStrings.Localizable.newAccountStorageDrive)
- .textStyle(.labelMediumAccent)
- .frame(maxWidth: .infinity, maxHeight: .infinity)
- .padding(8)
- .background(accentColor.secondary.swiftUIColor)
- .clipShape(Capsule())
- .multilineTextAlignment(.center)
- }
- .fixedSize(horizontal: false, vertical: true)
- .padding(.bottom, 24)
-
- Text(MailResourcesStrings.Localizable.newAccountDescription)
- .textStyle(.bodySmallSecondary)
- .padding(.bottom, 24)
- .multilineTextAlignment(.center)
-
- Spacer()
-
- MailButton(label: MailResourcesStrings.Localizable.buttonStart) {
- @InjectService var matomo: MatomoUtils
- matomo.track(eventWithCategory: .account, name: "openCreationWebview")
- isPresentingCreateAccount.toggle()
- }
- .mailButtonFullWidth(true)
- .padding(.bottom, 24)
- }
- .padding(.horizontal, 24)
- .sheet(isPresented: $isPresentingCreateAccount) {
- RegisterView(registrationProcess: .mail) { viewController in
- guard let viewController else { return }
- loginHandler.loginAfterAccountCreation(from: viewController)
- }
- }
- .matomoView(view: [MatomoUtils.View.onboarding.displayName, "CreateAccount"])
- }
-}
-
-struct CreateAccountView_Previews: PreviewProvider {
- static var previews: some View {
- CreateAccountView()
- }
-}
diff --git a/MailCore/Models/Settings/AccentColor.swift b/MailCore/Models/Settings/AccentColor.swift
index 69ccd28c4..5ab3a544f 100644
--- a/MailCore/Models/Settings/AccentColor.swift
+++ b/MailCore/Models/Settings/AccentColor.swift
@@ -99,15 +99,6 @@ public enum AccentColor: String, CaseIterable, SettingsOptionEnum {
}
}
- public var createAccountImage: MailResourcesImages {
- switch self {
- case .pink:
- return MailResourcesAsset.createAccountPink
- case .blue:
- return MailResourcesAsset.createAccountBlue
- }
- }
-
// MARK: Swipe settings icons
public var fullTrailingIcon: MailResourcesImages {
diff --git a/MailCore/Utils/Matomo+Extension.swift b/MailCore/Utils/Matomo+Extension.swift
index d2962cce3..d091632fc 100644
--- a/MailCore/Utils/Matomo+Extension.swift
+++ b/MailCore/Utils/Matomo+Extension.swift
@@ -26,7 +26,6 @@ import SwiftUI
public extension MatomoUtils.View {
static let accountView = MatomoUtils.View(displayName: "AccountView")
static let bottomSheet = MatomoUtils.View(displayName: "BottomSheet")
- static let onboarding = MatomoUtils.View(displayName: "Onboarding")
static let threadListView = MatomoUtils.View(displayName: "ThreadListView")
static let threadView = MatomoUtils.View(displayName: "ThreadView")
static let settingsView = MatomoUtils.View(displayName: "SettingsView")
diff --git a/MailResources/Assets.xcassets/create-account-blue.imageset/Contents.json b/MailResources/Assets.xcassets/create-account-blue.imageset/Contents.json
deleted file mode 100644
index fc66a9c06..000000000
--- a/MailResources/Assets.xcassets/create-account-blue.imageset/Contents.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "images" : [
- {
- "filename" : "create-account-blue-light.svg",
- "idiom" : "universal"
- },
- {
- "appearances" : [
- {
- "appearance" : "luminosity",
- "value" : "dark"
- }
- ],
- "filename" : "create-account-blue-dark.svg",
- "idiom" : "universal"
- }
- ],
- "info" : {
- "author" : "xcode",
- "version" : 1
- },
- "properties" : {
- "preserves-vector-representation" : true
- }
-}
diff --git a/MailResources/Assets.xcassets/create-account-blue.imageset/create-account-blue-dark.svg b/MailResources/Assets.xcassets/create-account-blue.imageset/create-account-blue-dark.svg
deleted file mode 100644
index d59e08bb3..000000000
--- a/MailResources/Assets.xcassets/create-account-blue.imageset/create-account-blue-dark.svg
+++ /dev/null
@@ -1,98 +0,0 @@
-
diff --git a/MailResources/Assets.xcassets/create-account-blue.imageset/create-account-blue-light.svg b/MailResources/Assets.xcassets/create-account-blue.imageset/create-account-blue-light.svg
deleted file mode 100644
index 7ccd51498..000000000
--- a/MailResources/Assets.xcassets/create-account-blue.imageset/create-account-blue-light.svg
+++ /dev/null
@@ -1,98 +0,0 @@
-
diff --git a/MailResources/Assets.xcassets/create-account-pink.imageset/Contents.json b/MailResources/Assets.xcassets/create-account-pink.imageset/Contents.json
deleted file mode 100644
index b67b935bb..000000000
--- a/MailResources/Assets.xcassets/create-account-pink.imageset/Contents.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "images" : [
- {
- "filename" : "create-account-pink-light.svg",
- "idiom" : "universal"
- },
- {
- "appearances" : [
- {
- "appearance" : "luminosity",
- "value" : "dark"
- }
- ],
- "filename" : "create-account-pink-dark.svg",
- "idiom" : "universal"
- }
- ],
- "info" : {
- "author" : "xcode",
- "version" : 1
- },
- "properties" : {
- "preserves-vector-representation" : true
- }
-}
diff --git a/MailResources/Assets.xcassets/create-account-pink.imageset/create-account-pink-dark.svg b/MailResources/Assets.xcassets/create-account-pink.imageset/create-account-pink-dark.svg
deleted file mode 100644
index 4a2f7366b..000000000
--- a/MailResources/Assets.xcassets/create-account-pink.imageset/create-account-pink-dark.svg
+++ /dev/null
@@ -1,98 +0,0 @@
-
diff --git a/MailResources/Assets.xcassets/create-account-pink.imageset/create-account-pink-light.svg b/MailResources/Assets.xcassets/create-account-pink.imageset/create-account-pink-light.svg
deleted file mode 100644
index abf0dd978..000000000
--- a/MailResources/Assets.xcassets/create-account-pink.imageset/create-account-pink-light.svg
+++ /dev/null
@@ -1,98 +0,0 @@
-
diff --git a/MailResources/Localizable/de.lproj/Localizable.strings b/MailResources/Localizable/de.lproj/Localizable.strings
index 304f9d08d..4ad407656 100644
--- a/MailResources/Localizable/de.lproj/Localizable.strings
+++ b/MailResources/Localizable/de.lproj/Localizable.strings
@@ -4,8 +4,8 @@
* Release: Working copy
* Locale: de, German
* Tagged: ios
- * Exported by: elena willen
- * Exported at: Thu, 31 Aug 2023 13:09:24 +0200
+ * Exported by: Valentin Perignon
+ * Exported at: Mon, 28 Aug 2023 09:59:22 +0200
*/
/* loco:6256793050618f7416758a32 */
@@ -1224,7 +1224,7 @@
"newAccountStorageDrive" = "15 GB kDrive-Speicher";
/* loco:64ca16484dbf65eb9b0ea862 */
-"pleaseLogInFirst" = "Bitte melden Sie sich zuerst in der Infomaniak Mail-App an.";
+"pleaseLogInFirst" = "Bitte melden Sie sich zuerst bei der Infomaniak Mail-App an.";
/* loco:64cca81829e8aeaec602e1c2 */
"settingsThreadModeTitle" = "Modus der Nachrichtenanzeige";
@@ -1273,6 +1273,3 @@
/* loco:64e7615fcdd6976491020982 */
"externalDialogDescriptionRecipient-plural-many" = "";
-
-/* loco:64edf250cb0c86ab3001d1b2 */
-"buttonStart" = "Anfangen";
diff --git a/MailResources/Localizable/en.lproj/Localizable.strings b/MailResources/Localizable/en.lproj/Localizable.strings
index daac33dec..5da9791eb 100644
--- a/MailResources/Localizable/en.lproj/Localizable.strings
+++ b/MailResources/Localizable/en.lproj/Localizable.strings
@@ -4,8 +4,8 @@
* Release: Working copy
* Locale: en, English
* Tagged: ios
- * Exported by: elena willen
- * Exported at: Thu, 31 Aug 2023 13:09:24 +0200
+ * Exported by: Valentin Perignon
+ * Exported at: Mon, 28 Aug 2023 09:59:22 +0200
*/
/* loco:6256793050618f7416758a32 */
@@ -1273,6 +1273,3 @@
/* loco:64e7615fcdd6976491020982 */
"externalDialogDescriptionRecipient-plural-many" = "";
-
-/* loco:64edf250cb0c86ab3001d1b2 */
-"buttonStart" = "Start";
diff --git a/MailResources/Localizable/es.lproj/Localizable.strings b/MailResources/Localizable/es.lproj/Localizable.strings
index 55ce65390..096bc6416 100644
--- a/MailResources/Localizable/es.lproj/Localizable.strings
+++ b/MailResources/Localizable/es.lproj/Localizable.strings
@@ -4,8 +4,8 @@
* Release: Working copy
* Locale: es, Spanish
* Tagged: ios
- * Exported by: elena willen
- * Exported at: Thu, 31 Aug 2023 13:09:24 +0200
+ * Exported by: Valentin Perignon
+ * Exported at: Mon, 28 Aug 2023 09:59:22 +0200
*/
/* loco:6256793050618f7416758a32 */
@@ -1273,6 +1273,3 @@
/* loco:64e7615fcdd6976491020982 */
"externalDialogDescriptionRecipient-plural-many" = "";
-
-/* loco:64edf250cb0c86ab3001d1b2 */
-"buttonStart" = "Empezar";
diff --git a/MailResources/Localizable/fr.lproj/Localizable.strings b/MailResources/Localizable/fr.lproj/Localizable.strings
index 07c71e894..1f7b475bb 100644
--- a/MailResources/Localizable/fr.lproj/Localizable.strings
+++ b/MailResources/Localizable/fr.lproj/Localizable.strings
@@ -4,8 +4,8 @@
* Release: Working copy
* Locale: fr, French
* Tagged: ios
- * Exported by: elena willen
- * Exported at: Thu, 31 Aug 2023 13:09:24 +0200
+ * Exported by: Valentin Perignon
+ * Exported at: Mon, 28 Aug 2023 09:59:22 +0200
*/
/* loco:6256793050618f7416758a32 */
@@ -1273,6 +1273,3 @@
/* loco:64e7615fcdd6976491020982 */
"externalDialogDescriptionRecipient-plural-many" = "Certains destinataires ne font pas partie de votre organisation ni de vos contacts. Soyez vigilant si vous partagez des informations sensibles.";
-
-/* loco:64edf250cb0c86ab3001d1b2 */
-"buttonStart" = "Commencer";
diff --git a/MailResources/Localizable/it.lproj/Localizable.strings b/MailResources/Localizable/it.lproj/Localizable.strings
index f1685e547..a1d04b859 100644
--- a/MailResources/Localizable/it.lproj/Localizable.strings
+++ b/MailResources/Localizable/it.lproj/Localizable.strings
@@ -4,8 +4,8 @@
* Release: Working copy
* Locale: it, Italian
* Tagged: ios
- * Exported by: elena willen
- * Exported at: Thu, 31 Aug 2023 13:09:24 +0200
+ * Exported by: Valentin Perignon
+ * Exported at: Mon, 28 Aug 2023 09:59:22 +0200
*/
/* loco:6256793050618f7416758a32 */
@@ -1273,6 +1273,3 @@
/* loco:64e7615fcdd6976491020982 */
"externalDialogDescriptionRecipient-plural-many" = "";
-
-/* loco:64edf250cb0c86ab3001d1b2 */
-"buttonStart" = "Inizia";