mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Adopt StateStoreViewModelV2 in the remaining settings screens. (#4158)
* 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.
This commit is contained in:
+52
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// 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 Foundation
|
||||
|
||||
enum DeactivateAccountScreenViewModelAction {
|
||||
case accountDeactivated
|
||||
}
|
||||
|
||||
struct DeactivateAccountScreenViewState: BindableState {
|
||||
let info: AttributedString
|
||||
let infoPoint1: AttributedString
|
||||
let infoPoint2 = AttributedString(L10n.screenDeactivateAccountListItem2)
|
||||
let infoPoint3 = AttributedString(L10n.screenDeactivateAccountListItem3)
|
||||
let infoPoint4 = AttributedString(L10n.screenDeactivateAccountListItem4)
|
||||
|
||||
var bindings = DeactivateAccountScreenViewStateBindings()
|
||||
|
||||
init() {
|
||||
let boldPlaceholder = "{bold}"
|
||||
var attributedString = AttributedString(L10n.screenDeactivateAccountDescription(boldPlaceholder))
|
||||
var boldString = AttributedString(L10n.screenDeactivateAccountDescriptionBoldPart)
|
||||
boldString.bold()
|
||||
attributedString.replace(boldPlaceholder, with: boldString)
|
||||
info = attributedString
|
||||
|
||||
attributedString = AttributedString(L10n.screenDeactivateAccountListItem1(boldPlaceholder))
|
||||
boldString = AttributedString(L10n.screenDeactivateAccountListItem1BoldPart)
|
||||
boldString.bold()
|
||||
attributedString.replace(boldPlaceholder, with: boldString)
|
||||
infoPoint1 = attributedString
|
||||
}
|
||||
}
|
||||
|
||||
struct DeactivateAccountScreenViewStateBindings {
|
||||
var password = ""
|
||||
var eraseData = false
|
||||
var alertInfo: AlertInfo<DeactivateAccountScreenAlert>?
|
||||
}
|
||||
|
||||
enum DeactivateAccountScreenAlert {
|
||||
case confirmation
|
||||
case deactivationFailed
|
||||
}
|
||||
|
||||
enum DeactivateAccountScreenViewAction {
|
||||
case deactivate
|
||||
}
|
||||
Reference in New Issue
Block a user