mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 00:01:00 +00:00
Cleanup
This commit is contained in:
parent
ceff3fd4c9
commit
9c77f55ec9
4 changed files with 11 additions and 12 deletions
|
@ -111,8 +111,4 @@ private extension AddIdentityViewModel {
|
|||
} receiveValue: { _ in }
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
func checkIfPublicTimelineAvailable(url: URL) -> AnyPublisher<Bool, Never> {
|
||||
Just(false).eraseToAnyPublisher()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -19,6 +19,7 @@ struct RootView: View {
|
|||
.navigationBarHidden(true)
|
||||
}
|
||||
.environmentObject(viewModel)
|
||||
.navigationViewStyle(StackNavigationViewStyle())
|
||||
.transition(.opacity)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue