Files
omnivore/apple/OmnivoreKit/Sources/Views/RegistrationViews/LoginErrorMessageView.swift
2022-02-23 15:28:43 -08:00

31 lines
605 B
Swift

import Models
import SwiftUI
public struct LoginErrorMessageView: View {
let loginError: LoginError
public init(loginError: LoginError) {
self.loginError = loginError
}
public var body: some View {
Text(loginError.message)
.font(.appBody)
.foregroundColor(.red)
.multilineTextAlignment(.leading)
}
}
private extension LoginError {
var message: String {
switch self {
case .unauthorized:
return LocalText.invalidCredsLoginError
case .network:
return LocalText.networkError
case .unknown:
return LocalText.genericError
}
}
}