MESSENGER-4231 add new loginflow

This commit is contained in:
JanNiklas Grabowski
2023-02-28 18:06:13 +01:00
parent 50b16e3979
commit fdafc1f2bf
12 changed files with 182 additions and 36 deletions
@@ -67,6 +67,9 @@ struct AuthenticationServerSelectionScreen: View {
message: Text(BWIL10n.authenticationServerSelectionServerDeniedMessage),
dismissButton: .default(Text(VectorL10n.ok)))
}
if BWIBuildSettings.shared.authScreenShowTestServerOptions {
serverSelectionButton
}
}
.readableFrame()
.padding(.horizontal, 16)
@@ -221,6 +224,24 @@ struct AuthenticationServerSelectionScreen: View {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
}
// bwi: show server selection button
var serverSelectionButton: some View {
VStack() {
Menu(content: {
ForEach(ServerURLHelper.shared.serverSettings, id: \.self) { server in
Button(server.name, action: {
viewModel.homeserverAddress = server.serverUrl
})
}
}, label: {
Button(action: { return }) {
Text(BWIL10n.bwiAuthBetaSelectionButtonTitle)
}
.buttonStyle(PrimaryActionButtonStyle())
})
}
}
}