Fix login screen sizes, add some spinners during login
This commit is contained in:
@ -174,7 +174,7 @@ struct ApplyLabelsView: View {
|
||||
}
|
||||
#elseif os(macOS)
|
||||
innerBody
|
||||
.frame(minWidth: 400, minHeight: 400)
|
||||
.frame(minWidth: 400, minHeight: 600)
|
||||
#endif
|
||||
}
|
||||
.task {
|
||||
|
||||
@ -138,7 +138,7 @@ struct LinkedItemMetadataEditView: View {
|
||||
)
|
||||
}
|
||||
}
|
||||
.frame(minWidth: 400, minHeight: 400)
|
||||
.frame(minWidth: 400, minHeight: 600)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ struct ProfileView: View {
|
||||
innerBody
|
||||
}
|
||||
.listStyle(InsetListStyle())
|
||||
.frame(minWidth: 400, minHeight: 400)
|
||||
.frame(minWidth: 400, minHeight: 600)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ enum EmailAuthState {
|
||||
@Published var emailAuthState = EmailAuthState.signIn
|
||||
@Published var potentialUsernameStatus = PotentialUsernameStatus.noUsername
|
||||
@Published var potentialUsername = ""
|
||||
@Published var isLoading = false
|
||||
|
||||
var subscriptions = Set<AnyCancellable>()
|
||||
}
|
||||
@ -68,7 +69,7 @@ struct EmailAuthView: View {
|
||||
}
|
||||
#else
|
||||
innerBody
|
||||
.frame(minWidth: 400, minHeight: 400)
|
||||
.frame(minWidth: 400, minHeight: 600)
|
||||
.buttonStyle(PlainButtonStyle())
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -11,8 +11,11 @@ extension EmailAuthViewModel {
|
||||
authenticator: Authenticator
|
||||
) async {
|
||||
do {
|
||||
isLoading = true
|
||||
try await authenticator.submitEmailLogin(email: email, password: password)
|
||||
isLoading = false
|
||||
} catch {
|
||||
isLoading = false
|
||||
if let newLoginError = error as? LoginError {
|
||||
if newLoginError == .pendingEmailVerification {
|
||||
emailAuthState = .pendingEmailVerification(email: email, password: password)
|
||||
@ -175,7 +178,13 @@ struct EmailPendingVerificationView: View {
|
||||
)
|
||||
}
|
||||
},
|
||||
label: { Text(LocalText.registrationStatusCheck) }
|
||||
label: {
|
||||
if viewModel.isLoading {
|
||||
ProgressView()
|
||||
} else {
|
||||
Text(LocalText.registrationStatusCheck)
|
||||
}
|
||||
}
|
||||
)
|
||||
.buttonStyle(SolidCapsuleButtonStyle(color: .appDeepBackground, width: 300))
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ extension EmailAuthViewModel {
|
||||
emailAuthState = .pendingEmailVerification(email: email, password: password)
|
||||
} catch {
|
||||
loginError = error as? LoginError
|
||||
emailAuthState = .signUp
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,6 +172,7 @@ struct EmailSignupFormView: View {
|
||||
|
||||
Button(
|
||||
action: {
|
||||
viewModel.emailAuthState = .loading
|
||||
Task {
|
||||
await viewModel.signUp(
|
||||
email: email,
|
||||
@ -180,7 +182,14 @@ struct EmailSignupFormView: View {
|
||||
)
|
||||
}
|
||||
},
|
||||
label: { Text(LocalText.genericSubmit) }
|
||||
label: {
|
||||
switch viewModel.emailAuthState {
|
||||
case .loading:
|
||||
ProgressView()
|
||||
default:
|
||||
Text(LocalText.genericSubmit)
|
||||
}
|
||||
}
|
||||
)
|
||||
.buttonStyle(SolidCapsuleButtonStyle(color: .appCtaYellow, width: 300))
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ struct InnerRootView: View {
|
||||
innerBody
|
||||
#elseif os(macOS)
|
||||
innerBody
|
||||
.frame(minWidth: 400, idealWidth: 1200, minHeight: 400, idealHeight: 1200)
|
||||
.frame(minWidth: 400, idealWidth: 1200, minHeight: 600, idealHeight: 1200)
|
||||
#endif
|
||||
}
|
||||
.onOpenURL { Authenticator.handleGoogleURL(url: $0) }
|
||||
|
||||
@ -196,7 +196,7 @@ struct WelcomeView: View {
|
||||
if let loginError = viewModel.loginError {
|
||||
HStack {
|
||||
LoginErrorMessageView(loginError: loginError)
|
||||
Spacer()
|
||||
.frame(maxWidth: 400, alignment: .leading)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user