Skip to content

Commit

Permalink
Added send button view & localized strings
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-nirali-s committed Jan 9, 2025
1 parent 8cfe7ab commit f9a79d2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 25 deletions.
18 changes: 15 additions & 3 deletions Splito/Localization/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
},
" ₹ 0.00" : {

},
" commented on" : {
"extractionState" : "manual"
},
" from the group" : {
"extractionState" : "manual"
Expand All @@ -28,6 +31,9 @@
" removed " : {
"extractionState" : "manual"
},
" to" : {
"extractionState" : "manual"
},
" to %@" : {

},
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -403,6 +412,9 @@
"First Name" : {
"extractionState" : "manual"
},
"for" : {
"extractionState" : "manual"
},
"Forgot password?" : {

},
Expand Down Expand Up @@ -474,9 +486,6 @@
},
"Join group" : {

},
"Key" : {
"extractionState" : "manual"
},
"Last Name" : {
"extractionState" : "manual"
Expand Down Expand Up @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion Splito/UI/Home/ActivityLog/ActivityLogView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)\".")
}
Expand Down
51 changes: 30 additions & 21 deletions Splito/UI/Home/Expense/Expense Detail/ExpenseDetailsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit f9a79d2

Please sign in to comment.