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

42 lines
793 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Models
import SwiftUI
struct ToggleAuthFlowButton: View {
let authFlow: AuthFlow
let action: () -> Void
var buttonTitle: String {
switch authFlow {
case .signIn:
return "Dont have an account? "
case .signUp:
return "Already have an account? "
}
}
var buttonTitleSuffix: String {
switch authFlow {
case .signIn:
return "Sign Up"
case .signUp:
return "Log In"
}
}
var body: some View {
Button(
action: action,
label: {
Text(buttonTitle)
.font(.appFootnote)
.foregroundColor(.appGrayText)
+ Text(buttonTitleSuffix)
.underline()
.font(.appFootnote)
.foregroundColor(.red)
}
)
.buttonStyle(PlainButtonStyle())
}
}