#1899, #1900, #1901 - Implement chat backup setting screens

This commit is contained in:
Stefan Ceriu
2023-10-19 15:34:10 +03:00
committed by GitHub
parent 15b5b44422
commit c8b9d95122
70 changed files with 2293 additions and 48 deletions
@@ -27,9 +27,7 @@ struct SettingsScreen: View {
Form {
userSection
if context.viewState.showSessionVerificationSection {
sessionVerificationSection
}
accountSecuritySection
mainSection
@@ -86,11 +84,22 @@ struct SettingsScreen: View {
}
}
private var sessionVerificationSection: some View {
Section {
ListRow(label: .default(title: L10n.actionCompleteVerification,
systemIcon: .checkmarkShield),
kind: .button { context.send(viewAction: .sessionVerification) })
@ViewBuilder
private var accountSecuritySection: some View {
if !context.viewState.isSessionVerified || context.viewState.chatBackupEnabled {
Section {
if !context.viewState.isSessionVerified {
ListRow(label: .default(title: L10n.actionCompleteVerification,
systemIcon: .checkmarkShield),
kind: .button { context.send(viewAction: .sessionVerification) })
} else if context.viewState.chatBackupEnabled {
ListRow(label: .default(title: L10n.commonChatBackup,
icon: Image(asset: Asset.Images.secureBackupIcon)),
details: context.viewState.showSecureBackupBadge ? .icon(secureBackupBadge) : nil,
kind: .navigationLink { context.send(viewAction: .secureBackup) })
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.secureBackup)
}
}
}
}
@@ -222,6 +231,13 @@ struct SettingsScreen: View {
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.done)
}
}
@ViewBuilder
private var secureBackupBadge: some View {
if context.viewState.showSecureBackupBadge {
BadgeView(size: 10)
}
}
}
private extension TimelineStyle {