Skip to content

Commit a4fd1fc

Browse files
authoredJan 2, 2025··
Add improvements
1 parent 37582c6 commit a4fd1fc

15 files changed

+41
-49
lines changed
 

‎BaseStyle/BaseStyle/Views/NavigationTitleTextView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public struct NavigationTitleTextView: View {
2121
}
2222

2323
public var body: some View {
24-
Text(text)
24+
Text(text.localized)
2525
.font(font)
2626
.foregroundStyle(foregroundColor)
2727
}

‎Splito.xcodeproj/project.pbxproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -329,15 +329,15 @@
329329
path = ActivityLog;
330330
sourceTree = "<group>";
331331
};
332-
2156A8AE2C24064400CFAB64 /* Transactions */ = {
332+
2156A8AE2C24064400CFAB64 /* Settlements */ = {
333333
isa = PBXGroup;
334334
children = (
335335
2156A8AF2C24069800CFAB64 /* GroupTransactionsRouteView.swift */,
336336
21B1C0992C1C59F10098B4FD /* GroupTransactionListView.swift */,
337337
21B1C09B2C1C5A040098B4FD /* GroupTransactionListViewModel.swift */,
338338
2177692E2C206678009B3B37 /* Transaction Detail */,
339339
);
340-
path = Transactions;
340+
path = Settlements;
341341
sourceTree = "<group>";
342342
};
343343
2177692E2C206678009B3B37 /* Transaction Detail */ = {
@@ -410,7 +410,7 @@
410410
isa = PBXGroup;
411411
children = (
412412
D83344562C0DD03B00CD9F05 /* Settle up */,
413-
2156A8AE2C24064400CFAB64 /* Transactions */,
413+
2156A8AE2C24064400CFAB64 /* Settlements */,
414414
D83344552C0DD02F00CD9F05 /* Balances */,
415415
D833445F2C0EF1D300CD9F05 /* Totals */,
416416
);

‎Splito/Localization/Localizable.xcstrings

+7-7
Original file line numberDiff line numberDiff line change
@@ -546,15 +546,15 @@
546546
},
547547
"No members in your selected group." : {
548548

549-
},
550-
"No payments yet!" : {
551-
552549
},
553550
"No results found for \"%@\"!" : {
554551

555552
},
556553
"No results were found that match your search criteria." : {
557554

555+
},
556+
"No settlements yet!" : {
557+
558558
},
559559
"No unsettled bills yet!" : {
560560

@@ -604,9 +604,6 @@
604604
"Payment made successfully." : {
605605
"extractionState" : "manual"
606606
},
607-
"Payments" : {
608-
"extractionState" : "manual"
609-
},
610607
"Payments made" : {
611608
"extractionState" : "manual"
612609
},
@@ -720,6 +717,9 @@
720717
},
721718
"settled up" : {
722719

720+
},
721+
"Settlements" : {
722+
"extractionState" : "manual"
723723
},
724724
"Share App" : {
725725
"extractionState" : "manual"
@@ -1038,4 +1038,4 @@
10381038
}
10391039
},
10401040
"version" : "1.0"
1041-
}
1041+
}

‎Splito/Plist/Info.plist

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
</array>
3636
<key>CFBundleVersion</key>
3737
<string>$(app_version_code)</string>
38+
<key>ITSAppUsesNonExemptEncryption</key>
39+
<false/>
3840
<key>LSRequiresIPhoneOS</key>
3941
<true/>
4042
<key>NSCameraUsageDescription</key>

‎Splito/UI/Home/Expense/AddExpenseViewModel.swift

+6-4
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,14 @@ extension AddExpenseViewModel {
172172
let payerIds = Array(self.selectedPayers.keys.prefix(2))
173173
let user1 = await self.fetchUserData(for: payerIds[0])
174174
let user2 = await self.fetchUserData(for: payerIds[1])
175-
if let user1, let user2 {
175+
if let user1, let user2, let currentUser = preference.user {
176+
let user1Name = user1.id == currentUser.id ? "You" : user1.nameWithLastInitial
177+
let user2Name = user2.id == currentUser.id ? "You" : user2.nameWithLastInitial
176178
if self.selectedPayers.count == 2 {
177-
self.payerName = "\(user1.nameWithLastInitial) and \(user2.nameWithLastInitial)"
179+
self.payerName = "\(user1Name) and \(user2Name)"
178180
} else {
179-
let remainingCount = self.selectedPayers.count - 2
180-
self.payerName = "\(user1.nameWithLastInitial), \(user2.nameWithLastInitial) and +\(remainingCount)"
181+
let remainingPayersCount = self.selectedPayers.count - 2
182+
self.payerName = "\(user1Name), \(user2Name) and +\(remainingPayersCount)"
181183
}
182184
}
183185
}

‎Splito/UI/Home/Expense/Detail Selection/Payer/ChoosePayerView.swift

+1-7
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ struct ChoosePayerView: View {
4545
)
4646
.onTapGestureForced {
4747
viewModel.handlePayerSelection(userId: user.id)
48+
dismiss()
4849
}
4950
}
5051

@@ -58,13 +59,6 @@ struct ChoosePayerView: View {
5859
}
5960
.scrollIndicators(.hidden)
6061
.scrollBounceBehavior(.basedOnSize)
61-
62-
PrimaryButton(text: "Save", isEnabled: !viewModel.selectedPayers.isEmpty, onClick: {
63-
viewModel.handleSaveBtnTap()
64-
dismiss()
65-
})
66-
.padding([.bottom, .horizontal], 16)
67-
.padding(.top, 8)
6862
}
6963
}
7064
.background(surfaceColor)

‎Splito/UI/Home/Expense/Detail Selection/Payer/ChoosePayerViewModel.swift

+1-5
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class ChoosePayerViewModel: BaseViewModel, ObservableObject {
5858
// MARK: - User Actions
5959
func handlePayerSelection(userId: String) {
6060
selectedPayers = [userId: amount]
61+
onPayerSelection(selectedPayers)
6162
}
6263

6364
func handleMultiplePayerTap() {
@@ -66,15 +67,10 @@ class ChoosePayerViewModel: BaseViewModel, ObservableObject {
6667
message: "Please enter a cost for your expense first!"))
6768
return
6869
}
69-
7070
router?.push(.ChooseMultiplePayerView(groupId: groupId, selectedPayers: selectedPayers,
7171
amount: amount, onPayerSelection: onPayerSelection))
7272
}
7373

74-
func handleSaveBtnTap() {
75-
onPayerSelection(selectedPayers)
76-
}
77-
7874
// MARK: - Error Handling
7975
private func handleServiceError() {
8076
if !networkMonitor.isConnected {

‎Splito/UI/Home/Groups/Group/Group Options/Settle up/Payment/GroupPaymentView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ struct DatePickerView: View {
178178

179179
@Binding var date: Date
180180

181-
private let maximumDate = Calendar.current.date(byAdding: .year, value: 0, to: Date()) ?? Date()
181+
private let maximumDate = Calendar.current.date(byAdding: .year, value: 1, to: Date()) ?? Date()
182182

183183
@State private var tempDate: Date
184184
@State private var showDatePicker = false

‎Splito/UI/Home/Groups/Group/Group Options/Transactions/GroupTransactionListView.swift ‎Splito/UI/Home/Groups/Group/Group Options/Settlements/GroupTransactionListView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct GroupTransactionListView: View {
3838
.toolbarRole(.editor)
3939
.toolbar {
4040
ToolbarItem(placement: .topBarLeading) {
41-
NavigationTitleTextView(text: "Payments")
41+
NavigationTitleTextView(text: "Settlements")
4242
}
4343
}
4444
}
@@ -251,7 +251,7 @@ private struct EmptyTransactionView: View {
251251
.frame(width: geometry.size.width * 0.5, height: geometry.size.width * 0.4)
252252
.padding(.bottom, 40)
253253

254-
Text("No payments yet!")
254+
Text("No settlements yet!")
255255
.font(.Header1())
256256
.foregroundStyle(primaryText)
257257
.multilineTextAlignment(.center)

‎Splito/UI/Home/Groups/Group/GroupExpenseListView.swift

-5
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ struct GroupExpenseListView: View {
123123
.padding(.vertical, 5)
124124
Spacer()
125125
}
126-
.onTapGestureForced {
127-
UIApplication.shared.endEditing()
128-
}
129126
}
130127
}
131128

@@ -288,7 +285,6 @@ private struct GroupExpenseHeaderView: View {
288285
.clipShape(RoundedRectangle(cornerRadius: 12))
289286
.padding(.horizontal, 16)
290287
.padding(.top, 8)
291-
.onTapGestureForced { UIApplication.shared.endEditing() }
292288
}
293289
}
294290

@@ -388,6 +384,5 @@ private struct ExpenseNotFoundView: View {
388384
.padding(.horizontal, 16)
389385
.frame(maxWidth: .infinity, alignment: .center)
390386
.frame(minHeight: geometry.size.height - 280, maxHeight: .infinity, alignment: .center)
391-
.onTapGestureForced { UIApplication.shared.endEditing() }
392387
}
393388
}

‎Splito/UI/Home/Groups/Group/GroupHomeView.swift

+17-14
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,13 @@ struct GroupHomeView: View {
4848
}
4949
}
5050
}
51+
.onTapGestureForced {
52+
UIApplication.shared.endEditing()
53+
}
5154
.frame(maxWidth: isIpad ? 600 : nil, alignment: .center)
5255
.frame(maxWidth: .infinity, alignment: .center)
5356
.background(surfaceColor)
57+
.toastView(toast: $viewModel.toast)
5458
.alertView.alert(isPresented: $viewModel.showAlert, alertStruct: viewModel.alert)
5559
.onDisappear {
5660
if viewModel.showSearchBar {
@@ -68,7 +72,18 @@ struct GroupHomeView: View {
6872
.ignoresSafeArea(.keyboard)
6973
}
7074
}
71-
.toastView(toast: $viewModel.toast)
75+
.toolbarRole(.editor)
76+
.toolbar {
77+
ToolbarItem(placement: .topBarLeading) {
78+
NavigationTitleTextView(text: viewModel.group?.name ?? "")
79+
}
80+
ToolbarItem(placement: .topBarTrailing) {
81+
ToolbarButtonView(systemImageName: "magnifyingglass", onClick: viewModel.handleSearchOptionTap)
82+
}
83+
ToolbarItem(placement: .topBarTrailing) {
84+
ToolbarButtonView(systemImageName: "gearshape", onClick: viewModel.handleSettingsOptionTap)
85+
}
86+
}
7287
.fullScreenCover(isPresented: $viewModel.showAddExpenseSheet) {
7388
ExpenseRouteView(selectedGroupId: viewModel.groupId)
7489
}
@@ -107,18 +122,6 @@ struct GroupHomeView: View {
107122
.presentationDetents([.height(sheetHeight)])
108123
.presentationCornerRadius(24)
109124
}
110-
.toolbarRole(.editor)
111-
.toolbar {
112-
ToolbarItem(placement: .topBarLeading) {
113-
NavigationTitleTextView(text: viewModel.group?.name ?? "")
114-
}
115-
ToolbarItem(placement: .topBarTrailing) {
116-
ToolbarButtonView(systemImageName: "magnifyingglass", onClick: viewModel.handleSearchOptionTap)
117-
}
118-
ToolbarItem(placement: .topBarTrailing) {
119-
ToolbarButtonView(systemImageName: "gearshape", onClick: viewModel.handleSettingsOptionTap)
120-
}
121-
}
122125
}
123126
}
124127

@@ -136,7 +139,7 @@ struct GroupOptionsListView: View {
136139
HStack(spacing: 8) {
137140
GroupOptionsButtonView(text: "Settle up", isForSettleUp: isSettleUpEnable, onTap: onSettleUpTap)
138141

139-
GroupOptionsButtonView(text: "Payments", onTap: onTransactionsTap)
142+
GroupOptionsButtonView(text: "Settlements", onTap: onTransactionsTap)
140143

141144
GroupOptionsButtonView(text: "Balances", onTap: onBalanceTap)
142145

0 commit comments

Comments
 (0)
Please sign in to comment.