Skip to content

Commit e174353

Browse files
authored
Karte/Konto löschen Dialog (#51)
1 parent ba74a83 commit e174353

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

Example/SnabblePayExample/Views/AccountView.swift

+20-23
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,19 @@ struct AccountView: View {
3333
BackgroundView()
3434
VStack(spacing: 16) {
3535
Spacer()
36-
CardView(model: viewModel, expand: true)
37-
AccountStateView(viewModel: viewModel)
38-
Spacer()
39-
Button {
40-
name = viewModel.customName
41-
edit.toggle()
42-
} label: {
43-
HStack {
44-
Image(systemName: "pencil")
45-
Text("Edit name")
46-
}
47-
.padding(.horizontal, 24)
48-
.padding(.vertical, 8)
49-
.overlay(
50-
RoundedRectangle(cornerRadius: 20)
51-
.stroke(Color.white, lineWidth: 2)
52-
)
53-
}
54-
Button {
55-
delete.toggle()
56-
} label: {
57-
HStack {
36+
ZStack(alignment: .topTrailing) {
37+
CardView(model: viewModel, expand: true)
38+
Button(action: {
39+
delete.toggle()
40+
}) {
5841
Image(systemName: "trash")
59-
Text("Delete account")
42+
.foregroundColor(Color.black)
6043
}
44+
.padding(.trailing, 30)
45+
.padding(.top, 10)
6146
}
47+
AccountStateView(viewModel: viewModel)
48+
Spacer()
6249
}
6350
.onAppear {
6451
viewModel.createMandate()
@@ -84,6 +71,16 @@ struct AccountView: View {
8471
self.presentationMode.wrappedValue.dismiss()
8572
}
8673
}
74+
.toolbar {
75+
ToolbarItem(placement: .navigationBarTrailing) {
76+
Button(action: {
77+
name = viewModel.customName
78+
edit.toggle()
79+
}) {
80+
Image(systemName: "square.and.pencil")
81+
}
82+
}
83+
}
8784
}
8885

8986
func submit() {

0 commit comments

Comments
 (0)