Skip to content

Commit

Permalink
fix : 선물 시 카톡 메시지 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
HamBP committed Oct 16, 2024
1 parent 818dd5b commit 5cdfe0d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ private fun TicketHolderInfo(
if (isGift && reservation.reservationState != ReservationState.CANCELED) {
val month = reservation.salesEndDateTime.month.value
val day = reservation.salesEndDateTime.dayOfMonth
val senderText = stringResource(id = R.string.gift_sender_description, reservation?.depositorName ?: "")
val dateText = stringResource(id = R.string.gift_expiration_date, month, day)
val buttonText = stringResource(id = R.string.gift_check)

Expand All @@ -336,7 +337,7 @@ private fun TicketHolderInfo(
sendMessage(
context = context,
giftUuid = reservation.giftUuid!!,
receiverName = reservation.visitorName,
senderText = senderText,
image = reservation.giftInviteImage,
dateText = dateText,
buttonText = buttonText
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ fun GiftCompleteScreen(
) {
val month = reservation?.salesEndDateTime?.month?.value ?: 0
val day = reservation?.salesEndDateTime?.dayOfMonth ?: 0
val senderText = stringResource(id = R.string.gift_sender_description, reservation?.depositorName ?: "")
val dateText = stringResource(id = R.string.gift_expiration_date, month, day)
val buttonText = stringResource(id = R.string.gift_check)

Expand Down Expand Up @@ -120,7 +121,7 @@ fun GiftCompleteScreen(
onClick = {
if (ShareClient.instance.isKakaoTalkSharingAvailable(context)) {
reservation?.let {
sendMessage(context, it, dateText, buttonText)
sendMessage(context, it, senderText, dateText, buttonText)
}
} else {
// TODO: 카카오톡 미설치 케이스 (아직은 고려 X)
Expand Down Expand Up @@ -188,14 +189,15 @@ fun GiftCompleteScreen(
private fun sendMessage(
context: Context,
reservation: ReservationDetail,
senderText: String,
dateText: String,
buttonText: String
) {
reservation.giftUuid?.let { giftUuid ->
sendMessage(
context,
giftUuid,
reservation.visitorName,
senderText,
reservation.giftInviteImage,
dateText,
buttonText
Expand All @@ -206,7 +208,7 @@ private fun sendMessage(
fun sendMessage(
context: Context,
giftUuid: String,
receiverName: String,
senderText: String,
image: String,
dateText: String,
buttonText: String
Expand All @@ -216,7 +218,7 @@ fun sendMessage(

val defaultFeed = FeedTemplate(
content = Content(
title = "To. $receiverName",
title = senderText,
description = dateText,
imageUrl = image,
link = Link(
Expand Down
1 change: 1 addition & 0 deletions presentation/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
<string name="gift_select_receiver">받는 분 선택하기</string>
<string name="gift_selected_image">선택된 선물 이미지</string>
<string name="gift_image">선물 편지에 포함될 이미지</string>
<string name="gift_sender_description">%s님이 보낸 선물이 도착했어요.</string>
<string name="gift_expiration_date">%d월 %d일까지 불티앱에서 선물을 등록해주세요.</string>
<string name="gift_check">선물 확인하기</string>
<string name="gift_resend_message">선물 링크 다시 보내기</string>
Expand Down

0 comments on commit 5cdfe0d

Please sign in to comment.