Skip to content

Commit

Permalink
feat : 결제 내역에 선물 케이스 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
HamBP committed Jul 19, 2024
1 parent 70bea32 commit 53b7536
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ internal fun String.toReservationState(): ReservationState {
"RESERVATION_COMPLETED" -> ReservationState.RESERVED
"WAITING_FOR_REFUND" -> ReservationState.REFUNDING
"REFUND_COMPLETED" -> ReservationState.REFUNDED
"WAITING_FOR_GIFT_RECEIPT" -> ReservationState.REGISTERING_GIFT
// TODO: 선물 등록 완료 상태 추가
else -> ReservationState.UNDEFINED
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ enum class ReservationState {
RESERVED,
REFUNDING,
REFUNDED,
REGISTERING_GIFT,
UNDEFINED,
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
minSdk = "26"
targetSdk = "34"
versionCode = "12"
versionName = "1.5.3"
versionName = "1.5.4"
packageName = "com.nexters.boolti"
compileSdk = "34"
targetJvm = "17"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ fun ReservationState.toDescriptionAndColorPair(): Pair<Int, Color> {
ReservationState.CANCELED -> Pair(R.string.reservations_canceled, Error)
ReservationState.RESERVED -> Pair(R.string.reservations_reserved, Success)
ReservationState.REFUNDED -> Pair(R.string.reservations_refunded, Error)
ReservationState.REGISTERING_GIFT -> Pair(R.string.reservations_registering_gift, Grey30)
ReservationState.UNDEFINED -> Pair(R.string.reservations_unknown, Error)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Divider
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
Expand Down Expand Up @@ -58,7 +59,10 @@ fun ReservationsScreen(

Scaffold(
topBar = {
BtBackAppBar(title = stringResource(id = R.string.my_ticketing_history), onClickBack = onBackPressed)
BtBackAppBar(
title = stringResource(id = R.string.my_ticketing_history),
onClickBack = onBackPressed
)
}
) { innerPadding ->
Box(
Expand Down Expand Up @@ -180,7 +184,27 @@ private fun ReservationItem(
tint = Grey50
)
}
Divider(thickness = 1.dp, color = Grey85)
HorizontalDivider(thickness = 1.dp, color = Grey85)
// TODO: 선물 여부 판별하는 임시 코드, 선물 여부 필드 추가되면 변경
if (reservation.reservationState == ReservationState.REGISTERING_GIFT) {
Row(
modifier = Modifier.height(34.dp),
verticalAlignment = Alignment.Bottom
) {
Icon(
modifier = Modifier.size(20.dp),
painter = painterResource(R.drawable.ic_gift),
contentDescription = null,
tint = Grey50
)
// TODO: 받는 사람 이름 연동, 현재 임시 코드
Text(
modifier = Modifier.padding(start = 8.dp),
text = "TO. 김불티",
style = MaterialTheme.typography.titleSmall.copy(color = Grey30)
)
}
}
Row(
modifier = Modifier.padding(top = 12.dp, bottom = 20.dp),
verticalAlignment = Alignment.CenterVertically,
Expand Down
34 changes: 34 additions & 0 deletions presentation/src/main/res/drawable/ic_gift.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:pathData="M16.667,6.667H3.333C2.873,6.667 2.5,7.04 2.5,7.5V9.167C2.5,9.627 2.873,10 3.333,10H16.667C17.127,10 17.5,9.627 17.5,9.167V7.5C17.5,7.04 17.127,6.667 16.667,6.667Z"
android:strokeLineJoin="round"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#A2A5B4"
android:strokeLineCap="round"/>
<path
android:pathData="M10,6.667V17.5"
android:strokeLineJoin="round"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#A2A5B4"
android:strokeLineCap="round"/>
<path
android:pathData="M15.833,10V15.833C15.833,16.275 15.658,16.699 15.345,17.012C15.033,17.324 14.608,17.5 14.167,17.5H5.833C5.391,17.5 4.967,17.324 4.655,17.012C4.342,16.699 4.167,16.275 4.167,15.833V10"
android:strokeLineJoin="round"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#A2A5B4"
android:strokeLineCap="round"/>
<path
android:pathData="M6.25,6.667C5.697,6.667 5.167,6.448 4.777,6.057C4.386,5.666 4.167,5.136 4.167,4.584C4.167,4.031 4.386,3.501 4.777,3.111C5.167,2.72 5.697,2.5 6.25,2.5C7.054,2.486 7.842,2.876 8.51,3.62C9.179,4.363 9.698,5.425 10,6.667C10.301,5.425 10.82,4.363 11.489,3.62C12.158,2.876 12.946,2.486 13.75,2.5C14.302,2.5 14.832,2.72 15.223,3.111C15.614,3.501 15.833,4.031 15.833,4.584C15.833,5.136 15.614,5.666 15.223,6.057C14.832,6.448 14.302,6.667 13.75,6.667"
android:strokeLineJoin="round"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#A2A5B4"
android:strokeLineCap="round"/>
</vector>
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 @@ -234,6 +234,7 @@
<string name="reservations_reserved">발권 완료</string>
<string name="reservations_refunded">취소 완료</string>
<string name="reservations_detail_view">상세 보기</string>
<string name="reservations_registering_gift">등록 대기</string>
<string name="reservations_unknown">알 수 없음</string>
<string name="reservations_ticket_count_price_format">"%s / %d매 / %,d원"</string>
<string name="reservations_ticket_count_price_format_short">%d매 / %,d원"</string>
Expand Down

0 comments on commit 53b7536

Please sign in to comment.