Files
element-x-ios/ElementX/Sources/Screens/Settings/DeactivateAccountScreen/DeactivateAccountScreenModels.swift
T
Mauro f7dd9cdcf8 Update copyright holding and dates (#4640)
* Update copyright holding and dates

* compound IDE Macros updated

* update copyright

* update copyrights done

* update templates and README
2025-10-21 14:34:56 +02:00

54 lines
1.7 KiB
Swift

//
// Copyright 2025 Element Creations Ltd.
// Copyright 2022-2025 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
}