mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-25 01:31:02 +00:00
Use normal NavigationLink
This commit is contained in:
parent
9c768c82e0
commit
98ac456be6
1 changed files with 12 additions and 21 deletions
|
@ -9,8 +9,6 @@ struct AddIdentityView: View {
|
|||
@Environment(\.accessibilityReduceMotion) var accessibilityReduceMotion
|
||||
@EnvironmentObject var rootViewModel: RootViewModel
|
||||
|
||||
@State private var navigateToRegister = false
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
Section {
|
||||
|
@ -45,27 +43,20 @@ struct AddIdentityView: View {
|
|||
} else {
|
||||
Button("add-identity.log-in",
|
||||
action: viewModel.logInTapped)
|
||||
if let instance = viewModel.instance, let url = viewModel.url,
|
||||
if viewModel.isPublicTimelineAvailable {
|
||||
Button("add-identity.browse", action: viewModel.browseTapped)
|
||||
}
|
||||
if let instance = viewModel.instance,
|
||||
let url = viewModel.url,
|
||||
instance.registrations {
|
||||
ZStack {
|
||||
NavigationLink(
|
||||
instance.approvalRequired
|
||||
? "add-identity.request-invite"
|
||||
: "add-identity.join",
|
||||
destination: RegistrationView(
|
||||
viewModel: viewModel.registrationViewModel(
|
||||
instance: instance,
|
||||
url: url)),
|
||||
isActive: $navigateToRegister) {
|
||||
EmptyView()
|
||||
}
|
||||
.hidden()
|
||||
Button(instance.approvalRequired
|
||||
? "add-identity.request-invite"
|
||||
: "add-identity.join") {
|
||||
navigateToRegister.toggle()
|
||||
}
|
||||
}
|
||||
}
|
||||
if viewModel.isPublicTimelineAvailable {
|
||||
Button("add-identity.browse", action: viewModel.browseTapped)
|
||||
url: url)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue