This commit is contained in:
Justin Mazzocchi 2020-09-12 00:36:59 -07:00
parent ceff3fd4c9
commit 9c77f55ec9
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
4 changed files with 11 additions and 12 deletions

View File

@ -111,8 +111,4 @@ private extension AddIdentityViewModel {
} receiveValue: { _ in }
.store(in: &cancellables)
}
func checkIfPublicTimelineAvailable(url: URL) -> AnyPublisher<Bool, Never> {
Just(false).eraseToAnyPublisher()
}
}

View File

@ -6,13 +6,16 @@ import ViewModels
struct AddIdentityView: View {
@StateObject var viewModel: AddIdentityViewModel
@Environment(\.accessibilityReduceMotion) var accessibilityReduceMotion
@EnvironmentObject var rootViewModel: RootViewModel
@State private var navigateToRegister = false
var body: some View {
Form {
Section {
TextField("add-identity.instance-url", text: $viewModel.urlFieldText)
.textContentType(.URL)
.autocapitalization(.none)
.disableAutocorrection(true)
.keyboardType(.URL)
@ -69,7 +72,7 @@ struct AddIdentityView: View {
.frame(maxWidth: .infinity, alignment: .center)
}
}
.animation(.default, if: !viewModel.loading)
.animation(.default, if: !accessibilityReduceMotion)
.alertItem($viewModel.alertItem)
.onReceive(viewModel.addedIdentityID) { id in
withAnimation {

View File

@ -12,16 +12,19 @@ struct RegistrationView: View {
Form {
HStack {
TextField("registration.username", text: $viewModel.registration.username)
.textContentType(.username)
.autocapitalization(.none)
.disableAutocorrection(true)
Text("@" + viewModel.instance.uri)
Text("@".appending(viewModel.instance.uri))
.foregroundColor(.secondary)
}
TextField("registration.email", text: $viewModel.registration.email)
.textContentType(.emailAddress)
.autocapitalization(.none)
.disableAutocorrection(true)
.keyboardType(.emailAddress)
SecureField("registration.password", text: $viewModel.registration.password)
.textContentType(.password)
SecureField("registration.password-confirmation", text: $viewModel.passwordConfirmation)
if viewModel.instance.approvalRequired {
VStack(alignment: .leading) {
@ -29,12 +32,8 @@ struct RegistrationView: View {
TextEditor(text: $viewModel.registration.reason)
}
}
Button("registration.server-rules") {
presentURL = viewModel.serverRulesURL
}
Button("registration.terms-of-service") {
presentURL = viewModel.termsOfServiceURL
}
Button("registration.server-rules") { presentURL = viewModel.serverRulesURL }
Button("registration.terms-of-service") { presentURL = viewModel.termsOfServiceURL }
Toggle("registration.agree-to-server-rules-and-terms-of-service",
isOn: $viewModel.registration.agreement)
Group {

View File

@ -19,6 +19,7 @@ struct RootView: View {
.navigationBarHidden(true)
}
.environmentObject(viewModel)
.navigationViewStyle(StackNavigationViewStyle())
.transition(.opacity)
}
}