@@ -54,12 +54,30 @@ struct EditTagView: View {
5454
5555 if viewModel. isExistingTag {
5656 Section {
57- Button ( action : {
57+ Button ( role : . destructive ) {
5858 viewModel. showDeleteConfirmation = true
59- } ) {
59+ } label : {
6060 Text ( SharedStrings . Button. delete)
6161 . foregroundColor ( . red)
6262 }
63+ . frame ( maxWidth: . infinity)
64+ }
65+ . confirmationDialog (
66+ Strings . deleteConfirmationTitle,
67+ isPresented: $viewModel. showDeleteConfirmation,
68+ titleVisibility: . visible
69+ ) {
70+ Button ( SharedStrings . Button. delete, role: . destructive) {
71+ Task {
72+ let success = await viewModel. deleteTag ( )
73+ if success {
74+ dismiss ( )
75+ }
76+ }
77+ }
78+ Button ( SharedStrings . Button. cancel, role: . cancel) { }
79+ } message: {
80+ Text ( Strings . deleteConfirmationMessage)
6381 }
6482 }
6583 }
@@ -78,23 +96,6 @@ struct EditTagView: View {
7896 . disabled ( viewModel. tagName. trimmingCharacters ( in: . whitespacesAndNewlines) . isEmpty)
7997 }
8098 }
81- . confirmationDialog (
82- Strings . deleteConfirmationTitle,
83- isPresented: $viewModel. showDeleteConfirmation,
84- titleVisibility: . visible
85- ) {
86- Button ( SharedStrings . Button. delete, role: . destructive) {
87- Task {
88- let success = await viewModel. deleteTag ( )
89- if success {
90- dismiss ( )
91- }
92- }
93- }
94- Button ( SharedStrings . Button. cancel, role: . cancel) { }
95- } message: {
96- Text ( Strings . deleteConfirmationMessage)
97- }
9899 . alert ( SharedStrings . Error. generic, isPresented: $viewModel. showError) {
99100 Button ( SharedStrings . Button. ok) { }
100101 } message: {
0 commit comments