@@ -16,9 +16,10 @@ struct SettingsView: View {
16
16
17
17
var body : some View {
18
18
19
- NavigationView {
19
+ NavigationStack {
20
20
21
21
Form {
22
+
22
23
Section ( header: Text ( " Network " ) ) {
23
24
if let network = viewModel. network, let url = viewModel. esploraURL {
24
25
Text ( network. capitalized)
@@ -39,6 +40,7 @@ struct SettingsView: View {
39
40
}
40
41
}
41
42
}
43
+
42
44
Section ( header: Text ( " Wallet " ) ) {
43
45
Button {
44
46
Task {
@@ -55,22 +57,14 @@ struct SettingsView: View {
55
57
. animation ( . easeInOut, value: viewModel. inspectedScripts)
56
58
}
57
59
}
60
+
58
61
Section ( header: Text ( " Danger Zone " ) ) {
59
62
Button {
60
63
showingShowSeedConfirmation = true
61
64
} label: {
62
65
Text ( String ( localized: " Show Seed " ) )
63
66
. foregroundStyle ( . red)
64
67
}
65
- . alert (
66
- " Are you sure you want to view the seed? " ,
67
- isPresented: $showingShowSeedConfirmation
68
- ) {
69
- Button ( " Yes " , role: . destructive) {
70
- isSeedPresented = true
71
- }
72
- Button ( " No " , role: . cancel) { }
73
- }
74
68
Button {
75
69
showingDeleteSeedConfirmation = true
76
70
} label: {
@@ -79,43 +73,49 @@ struct SettingsView: View {
79
73
. foregroundStyle ( . red)
80
74
}
81
75
}
82
- . alert (
83
- " Are you sure you want to delete the seed? " ,
84
- isPresented: $showingDeleteSeedConfirmation
85
- ) {
86
- Button ( " Yes " , role: . destructive) {
87
- viewModel. delete ( )
88
- }
89
- Button ( " No " , role: . cancel) { }
90
- }
91
76
}
77
+
92
78
}
93
79
. navigationTitle ( " Settings " )
94
80
. onAppear {
95
81
viewModel. getNetwork ( )
96
82
viewModel. getEsploraUrl ( )
97
83
}
98
- . sheet (
99
- isPresented: $isSeedPresented
100
- ) {
101
- SeedView ( viewModel: . init( ) )
102
- . presentationDetents ( [ . medium, . large] )
103
- . presentationDragIndicator ( . visible)
84
+
85
+ }
86
+ . sheet ( isPresented: $isSeedPresented) {
87
+ SeedView ( viewModel: . init( ) )
88
+ . presentationDetents ( [ . medium, . large] )
89
+ . presentationDragIndicator ( . visible)
90
+ }
91
+ . alert (
92
+ " Are you sure you want to view the seed? " ,
93
+ isPresented: $showingShowSeedConfirmation
94
+ ) {
95
+ Button ( " Yes " , role: . destructive) {
96
+ isSeedPresented = true
104
97
}
105
- . alert ( isPresented : $viewModel . showingSettingsViewErrorAlert ) {
106
- Alert (
107
- title : Text ( " Settings Error " ) ,
108
- message : Text ( viewModel . settingsError ? . description ?? " Unknown " ) ,
109
- dismissButton : . default ( Text ( " OK " ) ) {
110
- viewModel . settingsError = nil
111
- }
112
- )
98
+ Button ( " No " , role : . cancel ) { }
99
+ }
100
+ . alert (
101
+ " Are you sure you want to delete the seed? " ,
102
+ isPresented : $showingDeleteSeedConfirmation
103
+ ) {
104
+ Button ( " Yes " , role : . destructive ) {
105
+ viewModel . delete ( )
113
106
}
114
-
107
+ Button ( " No " , role: . cancel) { }
108
+ }
109
+ . alert ( isPresented: $viewModel. showingSettingsViewErrorAlert) {
110
+ Alert (
111
+ title: Text ( " Settings Error " ) ,
112
+ message: Text ( viewModel. settingsError? . description ?? " Unknown " ) ,
113
+ dismissButton: . default( Text ( " OK " ) ) {
114
+ viewModel. settingsError = nil
115
+ }
116
+ )
115
117
}
116
-
117
118
}
118
-
119
119
}
120
120
121
121
#if DEBUG
0 commit comments