mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
FF for QR code login + Login with qr code button (#2643)
This commit is contained in:
+15
-4
@@ -94,9 +94,17 @@ struct AuthenticationStartScreen: View {
|
||||
|
||||
/// The main action buttons.
|
||||
var buttons: some View {
|
||||
VStack(spacing: 12) {
|
||||
Button { context.send(viewAction: .login) } label: {
|
||||
Text(L10n.actionContinue)
|
||||
VStack(spacing: 16) {
|
||||
if context.viewState.isQRCodeLoginEnabled {
|
||||
Button { context.send(viewAction: .loginManually) } label: {
|
||||
Label(L10n.screenOnboardingSignInWithQrCode, icon: \.qrCode)
|
||||
}
|
||||
.buttonStyle(.compound(.primary))
|
||||
.accessibilityIdentifier(A11yIdentifiers.authenticationStartScreen.signInWithQr)
|
||||
}
|
||||
|
||||
Button { context.send(viewAction: .loginManually) } label: {
|
||||
Text(context.viewState.isQRCodeLoginEnabled ? L10n.screenOnboardingSignInManually : L10n.actionContinue)
|
||||
}
|
||||
.buttonStyle(.compound(.primary))
|
||||
.accessibilityIdentifier(A11yIdentifiers.authenticationStartScreen.signIn)
|
||||
@@ -109,7 +117,10 @@ struct AuthenticationStartScreen: View {
|
||||
// MARK: - Previews
|
||||
|
||||
struct AuthenticationStartScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let viewModel = AuthenticationStartScreenViewModel()
|
||||
static let viewModel = {
|
||||
ServiceLocator.shared.settings.qrCodeLoginEnabled = true
|
||||
return AuthenticationStartScreenViewModel(appSettings: ServiceLocator.shared.settings)
|
||||
}()
|
||||
|
||||
static var previews: some View {
|
||||
AuthenticationStartScreen(context: viewModel.context)
|
||||
|
||||
Reference in New Issue
Block a user