* Move the AuthenticationStartScreen into the Authentication directory.
* Commit the updated Sentry license.
No idea why they dropped the 2024 🤷♂️
* Use StateStoreViewModelV2 in BugReportScreen.
* Use StateStoreViewModelV2 in UserDetailsEditScreen.
* Use StateStoreViewModelV2 in NotificationSettingsScreen.
* Use StateStoreViewModelV2 in NotificationSettingsEditScreen.
* Use StateStoreViewModelV2 in LegalInformationScreen.
* Use StateStoreViewModelV2 in LogViewerScreen.
* Use StateStoreViewModelV2 in AnalyticsSettingsScreen.
* Rename AdvancedSettingsScreen directory.
* Use StateStoreViewModelV2 in EncryptionResetScreen.
* Use StateStoreViewModelV2 in EncryptionResetPasswordScreen.
* Use StateStoreViewModelV2 in SecureBackup…Screens.
* Use StateStoreViewModelV2 in LoginScreen.
Seems this one was ignored waiting on the fulfillment transitionValues implementation.
* Use StateStoreViewModelV2 in DeactivateAccountScreen.
* Move DeactivateAccountScreen into the Settings directory.
81 lines
2.9 KiB
Swift
81 lines
2.9 KiB
Swift
//
|
|
// Copyright 2022-2024 New Vector Ltd.
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
// Please see LICENSE files in the repository root for full details.
|
|
//
|
|
|
|
import Combine
|
|
import Compound
|
|
import SwiftUI
|
|
|
|
struct EncryptionResetPasswordScreen: View {
|
|
@Bindable var context: EncryptionResetPasswordScreenViewModel.Context
|
|
@FocusState private var textFieldFocus
|
|
|
|
var body: some View {
|
|
FullscreenDialog {
|
|
VStack(spacing: 16) {
|
|
BigIcon(icon: \.lockSolid)
|
|
|
|
Text(L10n.screenResetEncryptionPasswordTitle)
|
|
.foregroundColor(.compound.textPrimary)
|
|
.font(.compound.headingMDBold)
|
|
.multilineTextAlignment(.center)
|
|
|
|
Text(L10n.screenResetEncryptionPasswordSubtitle)
|
|
.foregroundColor(.compound.textSecondary)
|
|
.font(.compound.bodyMD)
|
|
.multilineTextAlignment(.center)
|
|
|
|
passwordSection
|
|
}
|
|
.padding(16)
|
|
} bottomContent: {
|
|
Button(L10n.actionResetIdentity, role: .destructive) {
|
|
context.send(viewAction: .submit)
|
|
}
|
|
.buttonStyle(.compound(.primary))
|
|
.accessibilityIdentifier(A11yIdentifiers.encryptionResetPasswordScreen.submit)
|
|
}
|
|
.background()
|
|
.backgroundStyle(.compound.bgCanvasDefault)
|
|
.interactiveDismissDisabled()
|
|
.onAppear { textFieldFocus = true }
|
|
}
|
|
|
|
@ViewBuilder
|
|
private var passwordSection: some View {
|
|
VStack(alignment: .leading, spacing: 8) {
|
|
Text(L10n.commonPassword)
|
|
.foregroundColor(.compound.textPrimary)
|
|
.font(.compound.bodySMSemibold)
|
|
|
|
SecureField(L10n.screenResetEncryptionPasswordPlaceholder, text: $context.password)
|
|
.tint(.compound.iconAccentTertiary)
|
|
.frame(maxWidth: .infinity)
|
|
.padding()
|
|
.background(Color.compound.bgSubtleSecondaryLevel0)
|
|
.clipShape(RoundedRectangle(cornerRadius: 8))
|
|
.focused($textFieldFocus)
|
|
.submitLabel(.done)
|
|
.onSubmit {
|
|
context.send(viewAction: .submit)
|
|
}
|
|
.accessibilityIdentifier(A11yIdentifiers.encryptionResetPasswordScreen.passwordField)
|
|
}
|
|
}
|
|
}
|
|
|
|
// MARK: - Previews
|
|
|
|
struct EncryptionResetPasswordScreen_Previews: PreviewProvider, TestablePreview {
|
|
static let passwordPublisher = PassthroughSubject<String, Never>()
|
|
static let viewModel = EncryptionResetPasswordScreenViewModel(passwordPublisher: passwordPublisher)
|
|
static var previews: some View {
|
|
NavigationStack {
|
|
EncryptionResetPasswordScreen(context: viewModel.context)
|
|
}
|
|
}
|
|
}
|