Skip to content

Commit eed26a9

Browse files
authored
UX/UI Anpassungen der Konto-/Karten-Detailseite (#49)
1 parent ebdcf83 commit eed26a9

File tree

4 files changed

+28
-29
lines changed

4 files changed

+28
-29
lines changed

Example/SnabblePayExample/Views/AccountStateView.swift

-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ struct AccountStateView: View {
3535
.frame(maxWidth: .infinity)
3636
.padding()
3737
}
38-
.background(viewModel.backgroundMaterial, in: RoundedRectangle(cornerRadius: 12))
3938
.padding([.leading, .trailing])
4039
Button {
4140
viewModel.decline(mandateId: mandate.id)
@@ -45,12 +44,10 @@ struct AccountStateView: View {
4544
.frame(maxWidth: .infinity)
4645
.padding()
4746
}
48-
.background(viewModel.backgroundMaterial, in: RoundedRectangle(cornerRadius: 12))
4947
.padding([.leading, .trailing])
5048
}
5149
.padding(.bottom)
5250
}
53-
.background(viewModel.backgroundMaterial, in: RoundedRectangle(cornerRadius: 12))
5451
.padding([.leading, .trailing])
5552
}
5653
}
@@ -106,7 +103,6 @@ struct AccountStateView: View {
106103
}
107104
}
108105
}
109-
.background(viewModel.backgroundMaterial, in: RoundedRectangle(cornerRadius: 12))
110106
.padding([.leading, .trailing])
111107
}
112108

@@ -118,7 +114,6 @@ struct AccountStateView: View {
118114
.foregroundColor(.red)
119115
.padding()
120116
}
121-
.background(viewModel.backgroundMaterial, in: RoundedRectangle(cornerRadius: 12))
122117
.padding([.leading, .trailing])
123118
} else {
124119
if viewModel.mandateState == .pending {

Example/SnabblePayExample/Views/AccountView.swift

+26-24
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,35 @@ struct AccountView: View {
3131
var body: some View {
3232
ZStack {
3333
BackgroundView()
34-
35-
VStack(spacing: 24) {
36-
ZStack(alignment: .topTrailing) {
37-
CardView(model: viewModel, expand: true)
38-
Button(action: {
39-
delete.toggle()
40-
}) {
34+
VStack(spacing: 16) {
35+
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 {
4158
Image(systemName: "trash")
59+
Text("Delete account")
4260
}
43-
.padding(.trailing, 30)
44-
.padding(.top, 10)
4561
}
46-
AccountStateView(viewModel: viewModel)
47-
Spacer()
4862
}
49-
.padding([.top], 100)
50-
.padding([.bottom], 20)
5163
.onAppear {
5264
viewModel.createMandate()
5365
}
@@ -57,7 +69,7 @@ struct AccountView: View {
5769
}
5870
}
5971
}
60-
.edgesIgnoringSafeArea(.all)
72+
.padding(.bottom, 16)
6173
.navigationBarTitleDisplayMode(.inline)
6274
.navigationTitle(viewModel.customName)
6375
.alert("Your account", isPresented: $edit) {
@@ -72,16 +84,6 @@ struct AccountView: View {
7284
self.presentationMode.wrappedValue.dismiss()
7385
}
7486
}
75-
.toolbar {
76-
ToolbarItem(placement: .navigationBarTrailing) {
77-
Button(action: {
78-
name = viewModel.customName
79-
edit.toggle()
80-
}) {
81-
Image(systemName: "square.and.pencil")
82-
}
83-
}
84-
}
8587
}
8688

8789
func submit() {

Example/SnabblePayExample/de.lproj/Localizable.strings

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"Your account" = "Dein Konto";
2424
"Account Name" = "Kontobezeichnung";
2525
"Give this account a name." = "Gib deinem Konto einen Namen.";
26+
"Edit name" = "Name barbeiten";
2627
"Delete account" = "Karte löschen";
2728
"Delete" = "Löschen";
2829

Example/SnabblePayExample/en.lproj/Localizable.strings

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"Account Name" = "Account Name";
2020
"Give this account a name." = "Give this account a name.";
2121
"Delete account" = "Delete account";
22+
"Edit name" = "Edit name";
2223
"Delete" = "Delete";
2324

2425
/* Error handling */

0 commit comments

Comments
 (0)