ui: swap finalize migration buttons (make destructive harder to reach, consistent order of primary and destructive with previous page) (#3931)

This commit is contained in:
spaced4ndy
2024-03-20 20:20:10 +04:00
committed by GitHub
parent c2707d3c2b
commit d2e6313ce3
2 changed files with 21 additions and 21 deletions
@@ -333,16 +333,16 @@ struct MigrateFromDevice: View {
ZStack {
List {
Section {
Button(action: { alert = .deleteChat() }) {
settingsRow("trash.fill") {
Text("Delete database from this device").foregroundColor(.accentColor)
}
}
Button(action: { alert = .startChat() }) {
settingsRow("play.fill") {
Text("Start chat").foregroundColor(.red)
}
}
Button(action: { alert = .deleteChat() }) {
settingsRow("trash.fill") {
Text("Delete database from this device").foregroundColor(.accentColor)
}
}
} header: {
Text("Migration complete")
} footer: {
@@ -375,22 +375,6 @@ private fun MutableState<MigrationFromState>.LinkShownView(fileId: Long, link: S
private fun MutableState<MigrationFromState>.FinishedView(chatDeletion: Boolean) {
Box {
SectionView(stringResource(MR.strings.migrate_from_device_migration_complete).uppercase()) {
SettingsActionItemWithContent(
icon = painterResource(MR.images.ic_delete_forever),
text = stringResource(MR.strings.migrate_from_device_delete_database_from_device),
textColor = MaterialTheme.colors.primary,
click = {
AlertManager.shared.showAlertDialog(
title = generalGetString(MR.strings.delete_chat_profile_question),
text = generalGetString(MR.strings.delete_chat_profile_action_cannot_be_undone_warning),
confirmText = generalGetString(MR.strings.delete_verb),
onConfirm = {
deleteChatAndDismiss()
}
)
}
) {}
SettingsActionItemWithContent(
icon = painterResource(MR.images.ic_play_arrow_filled),
text = stringResource(MR.strings.migrate_from_device_start_chat),
@@ -406,6 +390,22 @@ private fun MutableState<MigrationFromState>.FinishedView(chatDeletion: Boolean)
)
}
) {}
SettingsActionItemWithContent(
icon = painterResource(MR.images.ic_delete_forever),
text = stringResource(MR.strings.migrate_from_device_delete_database_from_device),
textColor = MaterialTheme.colors.primary,
click = {
AlertManager.shared.showAlertDialog(
title = generalGetString(MR.strings.delete_chat_profile_question),
text = generalGetString(MR.strings.delete_chat_profile_action_cannot_be_undone_warning),
confirmText = generalGetString(MR.strings.delete_verb),
onConfirm = {
deleteChatAndDismiss()
}
)
}
) {}
SectionTextFooter(annotatedStringResource(MR.strings.migrate_from_device_you_must_not_start_database_on_two_device))
SectionTextFooter(annotatedStringResource(MR.strings.migrate_from_device_using_on_two_device_breaks_encryption))
}