Added the "notSupported" case to the MessageView component for the Browse module.

This commit is contained in:
Javier Cicchelli 2022-12-16 01:13:05 +01:00
parent e982a8f689
commit bc40f46649
3 changed files with 17 additions and 0 deletions

View File

@ -21,6 +21,9 @@
"message.type_error.text.first" = "An error occurred while loading this data";
"message.type_error.text.second" = "Please try loading this data again at a later time.";
"message.type_error.button.text" = "Try again";
"message.type_not_supported.text.first" = "This type of document cannot be opened yet";
"message.type_not_supported.text.second" = "Please be patient while the support for this type of document is being built by our development team.";
"message.type_not_supported.button.text" = "Go back to folder";
// BrowseView

View File

@ -66,6 +66,7 @@ struct MessageView: View {
extension MessageView {
enum MessageType {
case noCredentials
case notSupported
case empty
case error
}
@ -76,6 +77,8 @@ private extension MessageView.MessageType {
switch self {
case .noCredentials:
return "message.type_no_credentials.text.first"
case .notSupported:
return "message.type_not_supported.text.first"
case .empty:
return "message.type_empty.text.first"
case .error:
@ -87,6 +90,8 @@ private extension MessageView.MessageType {
switch self {
case .noCredentials:
return "message.type_no_credentials.text.second"
case .notSupported:
return "message.type_not_supported.text.second"
case .empty:
return "message.type_empty.text.second"
case .error:
@ -98,6 +103,8 @@ private extension MessageView.MessageType {
switch self {
case .noCredentials:
return "message.type_no_credentials.button.text"
case .notSupported:
return "message.type_not_supported.button.text"
case .empty:
return "message.type_empty.button.text"
case .error:
@ -121,6 +128,11 @@ struct MessageView_Previews: PreviewProvider {
}
.previewDisplayName("View of type no credentials")
MessageView(type: .notSupported) {
// action closure.
}
.previewDisplayName("View of type not supported")
MessageView(type: .empty) {
// action closure.
}

View File

@ -79,6 +79,8 @@ private extension BrowseView {
type: .noCredentials,
action: login
)
case .notSupported:
EmptyView()
case .loading:
LoadingView()
case .loaded: