-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/#36] participant overview, dropdown 구현 #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
2ae13f8
d5db1a7
1ee7e91
9ff7b3c
e3327fb
0356e1c
6935dda
ad1f83f
945f047
c1aa6b5
9729883
55881f8
685217c
6b78340
54c4809
7307ccb
006fbff
22978ce
d9e1fa0
34cdfa1
a2be37f
6a7f5af
30c663a
43ae70f
8336056
8554a06
67d85a9
f69eb54
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,7 @@ data class DepositItem( | |
|
|
||
| sealed interface DetailState { | ||
| val fields: List<Pair<FieldType, String>> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: 가독성 측면에서 봤을 때 Pair 쓰기보다 data class 로 분리하고 label, price 등 이름을 명시하는게 좋을 것 같은데 어떻게 생각하시나요?? |
||
| @get:StringRes | ||
| val buttonLabelId: Int? | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: StringRes 사용해주세용
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| val onButtonClick: (() -> Unit)? | ||
|
|
||
|
|
@@ -122,6 +123,7 @@ fun HistoryParticipantDetail( | |
| userName: String, | ||
| userImageUrl: String, | ||
| depositItems: List<DepositItem>, | ||
| totalPrice: Int, | ||
| detailState: DetailState, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
|
|
@@ -155,7 +157,6 @@ fun HistoryParticipantDetail( | |
| overflow = TextOverflow.Ellipsis, | ||
| modifier = Modifier | ||
| .weight(1f) | ||
| .padding(vertical = 2.dp), | ||
| ) | ||
| } | ||
|
|
||
|
|
@@ -173,7 +174,6 @@ fun HistoryParticipantDetail( | |
| color = colors.black, | ||
| ) | ||
| Column( | ||
| modifier = Modifier.fillMaxWidth(), | ||
| verticalArrangement = Arrangement.spacedBy(8.dp), | ||
| ) { | ||
| depositItems.forEach { item -> | ||
|
|
@@ -202,7 +202,7 @@ fun HistoryParticipantDetail( | |
| ) | ||
|
|
||
| Text( | ||
| text = priceText(depositItems.sumOf { it.price }), | ||
| text = priceText(totalPrice), | ||
| style = typography.body16sb, | ||
| color = colors.black, | ||
| ) | ||
|
|
@@ -296,6 +296,7 @@ private fun HistoryParticipantDetailPreview() { | |
| contact = "010-1111-1111", | ||
| invoice = "우체국 37249720348093", | ||
| ), | ||
| totalPrice = depositItems.sumOf { it.price }, | ||
| modifier = Modifier.width(311.dp), | ||
| ) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| package com.poti.android.presentation.history.component | ||
|
|
||
| import androidx.compose.animation.AnimatedVisibility | ||
| import androidx.compose.animation.Crossfade | ||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.Column | ||
|
|
@@ -26,6 +27,7 @@ import androidx.compose.ui.tooling.preview.Preview | |
| import androidx.compose.ui.unit.dp | ||
| import com.poti.android.R | ||
| import com.poti.android.core.common.extension.noRippleClickable | ||
| import com.poti.android.core.common.util.screenWidthDp | ||
| import com.poti.android.core.designsystem.component.display.PotiItemOptionType | ||
| import com.poti.android.core.designsystem.theme.PotiTheme | ||
|
|
||
|
|
@@ -34,6 +36,7 @@ fun HistoryParticipantDropdown( | |
| userName: String, | ||
| userImageUrl: String, | ||
| depositItems: List<DepositItem>, | ||
| depositTotalPrice: Int, | ||
| detailState: DetailState, | ||
| stageType: ParticipantStateLabelStage, | ||
| statusType: ParticipantStateLabelStatus, | ||
|
|
@@ -49,7 +52,8 @@ fun HistoryParticipantDropdown( | |
| ) { | ||
| Column( | ||
| modifier = Modifier | ||
| .padding(vertical = 20.dp, horizontal = 16.dp), | ||
| .padding(vertical = 20.dp, | ||
| horizontal = screenWidthDp(16.dp)), | ||
| ) { | ||
| ParticipantDropdownHeader( | ||
| name = userName, | ||
|
|
@@ -64,6 +68,7 @@ fun HistoryParticipantDropdown( | |
| userImageUrl = userImageUrl, | ||
| depositItems = depositItems, | ||
| detailState = detailState, | ||
| totalPrice = depositTotalPrice, | ||
| modifier = Modifier.padding(top = 20.dp), | ||
| ) | ||
| } | ||
|
|
@@ -102,17 +107,22 @@ private fun ParticipantDropdownHeader( | |
| modifier = Modifier.padding(vertical = 2.dp), | ||
| ) | ||
| Spacer(modifier = Modifier.width(8.dp)) | ||
| Icon( | ||
| painter = painterResource( | ||
| id = if (expanded) { | ||
| R.drawable.ic_arrow_up_lg | ||
| } else { | ||
| R.drawable.ic_arrow_down_lg | ||
| }, | ||
| ), | ||
| contentDescription = null, | ||
| tint = PotiTheme.colors.gray700, | ||
| ) | ||
|
|
||
| Crossfade( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p3: 왕 굿 |
||
| targetState = expanded | ||
| ) { expand -> | ||
| Icon( | ||
| painter = painterResource( | ||
| id = if (expand) { | ||
| R.drawable.ic_arrow_up_lg | ||
| } else { | ||
| R.drawable.ic_arrow_down_lg | ||
| }, | ||
| ), | ||
| contentDescription = null, | ||
| tint = PotiTheme.colors.gray700, | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -153,6 +163,7 @@ fun HistoryParticipantDropdownPreview() { | |
| userName = "어쩌구저쩌구".repeat(20), | ||
| userImageUrl = "", | ||
| depositItems = depositItems, | ||
| depositTotalPrice = depositItems.sumOf { it.price }, | ||
| detailState = DetailState.AfterDelivery( | ||
| name = "어쩌구", | ||
| delivery = "(01234) 서울특별시 솝트구 다솝로 456", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,8 @@ import androidx.compose.ui.Modifier | |
| import androidx.compose.ui.text.style.TextOverflow | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.poti.android.core.common.util.screenHeightDp | ||
| import com.poti.android.core.common.util.screenWidthDp | ||
| import com.poti.android.core.designsystem.component.display.PotiItemOption | ||
| import com.poti.android.core.designsystem.component.display.PotiItemOptionSize | ||
| import com.poti.android.core.designsystem.component.display.PotiItemOptionType | ||
|
|
@@ -23,21 +25,21 @@ import com.poti.android.core.designsystem.theme.PotiTheme.colors | |
|
|
||
| @Composable | ||
| fun HistoryParticipantOverview( | ||
| modifier: Modifier = Modifier, | ||
| memberList: List<String>, | ||
| userName: String, | ||
| address: String, | ||
| phone: String, | ||
| memberList: String, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p3: String으로 바꿔준거 좋네염!! |
||
| userInfo: String, | ||
| deliveryMethod: String, | ||
| price: Int, | ||
| participantStageType: ParticipantStateLabelStage, | ||
| participantStatusType: ParticipantStateLabelStatus, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| Column( | ||
| modifier = modifier | ||
| .fillMaxWidth() | ||
| .background(colors.white) | ||
| .padding(16.dp), | ||
| .padding( | ||
| horizontal = ( 16.dp), | ||
| vertical = screenHeightDp(16.dp)), | ||
| verticalArrangement = Arrangement.spacedBy(12.dp), | ||
| horizontalAlignment = Alignment.Start, | ||
| ) { | ||
|
|
@@ -46,7 +48,7 @@ fun HistoryParticipantOverview( | |
| horizontalArrangement = Arrangement.SpaceBetween, | ||
| ) { | ||
| Text( | ||
| text = memberList.joinToString(", "), | ||
| text = memberList, | ||
| style = PotiTheme.typography.body16m, | ||
| color = colors.black, | ||
| maxLines = 1, | ||
|
|
@@ -63,10 +65,11 @@ fun HistoryParticipantOverview( | |
| } | ||
|
|
||
| Text( | ||
| text = "$userName\n$address\n$phone", | ||
| text = userInfo, | ||
| style = PotiTheme.typography.body14m, | ||
| color = colors.gray800, | ||
| ) | ||
|
|
||
| Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) { | ||
| PotiItemOption( | ||
| optionType = PotiItemOptionType.DELIVERY, | ||
|
|
@@ -89,12 +92,15 @@ private fun priceText(price: Int) = String.format("%,d원", price) | |
| @Composable | ||
| private fun HistoryParticipantOverviewPreview() { | ||
| PotiTheme { | ||
| val members = listOf("멤버명", "멤버명", "멤버명", "멤버명", "멤버명", "멤버명", "멤버명") | ||
| val userName = "이포티" | ||
| val zipcode = "01234" | ||
| val address = "서울특별시 솝트구 다솝로 456" | ||
| val phone = "010-2345-2345" | ||
|
|
||
| HistoryParticipantOverview( | ||
| memberList = | ||
| listOf("멤버명", "멤버명", "멤버명", "멤버명", "멤버명", "멤버명", "멤버명"), | ||
| address = "(01234) 서울특별시 솝트구 다솝로 456", | ||
| userName = "이포티", | ||
| phone = "010-2345-2345", | ||
| memberList = members.joinToString(", "), | ||
| userInfo = "$userName\n($zipcode) $address\n$phone", | ||
| deliveryMethod = "준등기", | ||
| price = 12800, | ||
| participantStageType = ParticipantStateLabelStage.DEPOSIT, | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.