diff --git a/Splito/Localization/Localizable.xcstrings b/Splito/Localization/Localizable.xcstrings index 4ee8b183..02f3eac3 100644 --- a/Splito/Localization/Localizable.xcstrings +++ b/Splito/Localization/Localizable.xcstrings @@ -15,6 +15,9 @@ }, " ₹ 0.00" : { + }, + " commented on" : { + "extractionState" : "manual" }, " from the group" : { "extractionState" : "manual" @@ -28,6 +31,9 @@ " removed " : { "extractionState" : "manual" }, + " to" : { + "extractionState" : "manual" + }, " to %@" : { }, @@ -213,6 +219,9 @@ }, "Ana borrows $10 from Bob" : { + }, + "and changed the cover photo." : { + "extractionState" : "manual" }, "Apologies, we were not able to complete the authentication process. Please try again later." : { "extractionState" : "manual" @@ -403,6 +412,9 @@ "First Name" : { "extractionState" : "manual" }, + "for" : { + "extractionState" : "manual" + }, "Forgot password?" : { }, @@ -474,9 +486,6 @@ }, "Join group" : { - }, - "Key" : { - "extractionState" : "manual" }, "Last Name" : { "extractionState" : "manual" @@ -985,6 +994,9 @@ "You can't remove %@ from this group because they have outstanding debts with other group members. Please make sure all of %@'s debts have been settle up, and try again." : { "extractionState" : "manual" }, + "You do not have permission to add a comment on this expense, Sorry!" : { + "extractionState" : "manual" + }, "You do not owe anything" : { "extractionState" : "manual" }, diff --git a/Splito/UI/Home/ActivityLog/ActivityLogView.swift b/Splito/UI/Home/ActivityLog/ActivityLogView.swift index 9f095549..4e644eb4 100644 --- a/Splito/UI/Home/ActivityLog/ActivityLogView.swift +++ b/Splito/UI/Home/ActivityLog/ActivityLogView.swift @@ -287,7 +287,7 @@ private struct ActivityLogDescriptionView: View { @ViewBuilder private func expenseCommentAddedDescription() -> some View { - let comment = activityLog.comment ?? "Some comment" + let comment = activityLog.comment ?? "unknown" highlightedText(actionUserName) + disabledText(" commented on") + highlightedText(" \"\(activityLog.expenseName ?? "")\"") + disabledText(" in") + highlightedText(" \"\(groupName)\":") + disabledText(" \"\(comment)\".") } diff --git a/Splito/UI/Home/Expense/Expense Detail/ExpenseDetailsView.swift b/Splito/UI/Home/Expense/Expense Detail/ExpenseDetailsView.swift index f0caa89d..f7f42091 100644 --- a/Splito/UI/Home/Expense/Expense Detail/ExpenseDetailsView.swift +++ b/Splito/UI/Home/Expense/Expense Detail/ExpenseDetailsView.swift @@ -142,11 +142,9 @@ private struct CommentListView: View { let user = viewModel.getMemberDataBy(id: comment.commentedBy) return viewModel.preference.user?.id == user?.id ? "You" : user?.fullName ?? "someone" } - var memberProfileUrl: String? { - return viewModel.getMemberDataBy(id: comment.commentedBy)?.imageUrl - } - - CommentCellView(comment: comment, memberName: memberName, memberProfileUrl: memberProfileUrl, + + CommentCellView(comment: comment, memberName: memberName, + memberProfileUrl: viewModel.getMemberDataBy(id: comment.commentedBy)?.imageUrl, isLastComment: comments.last?.id == comment.id) } } @@ -226,22 +224,33 @@ private struct AddCommentTextField: View { .padding(.leading, 16) .padding(.vertical, 12) - if showLoader { - ImageLoaderView() - .padding(12) - } else { - Button { - isFocused.wrappedValue = false - onSendCommentBtnTap() - } label: { - Image(.sendIcon) - .resizable() - .scaledToFit() - .frame(width: 40, height: 40) - .foregroundStyle(primaryColor) - .padding(4) - } - .disabled(comment.trimming(spaces: .leadingAndTrailing).isEmpty) + SendButtonView(showLoader: showLoader, onClick: { + isFocused.wrappedValue = false + onSendCommentBtnTap() + }) + .disabled(comment.trimming(spaces: .leadingAndTrailing).isEmpty) + } + } +} + +private struct SendButtonView: View { + + let showLoader: Bool + + let onClick: () -> Void + + var body: some View { + if showLoader { + ImageLoaderView() + .padding(12) + } else { + Button(action: onClick) { + Image(.sendIcon) + .resizable() + .scaledToFit() + .frame(width: 40, height: 40) + .foregroundStyle(primaryColor) + .padding(4) } } }