Skip to content

Commit

Permalink
feat: Display loading overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinperignon committed Jun 16, 2023
1 parent f863f56 commit 531c175
Showing 1 changed file with 25 additions and 14 deletions.
39 changes: 25 additions & 14 deletions Mail/Views/New Message/V2/ComposeMessageViewV2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import InfomaniakCoreUI
import InfomaniakDI
import Introspect
import MailCore
import MailResources
import RealmSwift
Expand Down Expand Up @@ -130,6 +131,16 @@ struct ComposeMessageViewV2: View {
DraftManager.shared.syncDraft(mailboxManager: mailboxManager)
}
}
.overlay {
if isLoadingContent {
ProgressView()
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(MailResourcesAsset.backgroundColor.swiftUIColor)
}
}
.introspectScrollView { scrollView in
scrollView.keyboardDismissMode = .interactive
}
.navigationTitle(MailResourcesStrings.Localizable.buttonNewMessage)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
Expand All @@ -148,22 +159,22 @@ struct ComposeMessageViewV2: View {
}
}
.interactiveDismissDisabled()
.customAlert(isPresented: $alert.isShowing) {
switch alert.state {
case let .link(handler):
AddLinkView(actionHandler: handler)
case let .emptySubject(handler):
EmptySubjectView(actionHandler: handler)
case .none:
EmptyView()
}
.customAlert(isPresented: $alert.isShowing) {
switch alert.state {
case let .link(handler):
AddLinkView(actionHandler: handler)
case let .emptySubject(handler):
EmptySubjectView(actionHandler: handler)
case .none:
EmptyView()
}
.customAlert(isPresented: $isShowingCancelAttachmentsError) {
AttachmentsUploadInProgressErrorView {
dismiss()
}
}
.customAlert(isPresented: $isShowingCancelAttachmentsError) {
AttachmentsUploadInProgressErrorView {
dismiss()
}
.matomoView(view: ["ComposeMessage"])
}
.matomoView(view: ["ComposeMessage"])
}

private func didTouchDismiss() {
Expand Down

0 comments on commit 531c175

Please sign in to comment.