Skip to content

Commit

Permalink
Merge pull request #148 from YAPP-Github/QA/15-21-sent-card
Browse files Browse the repository at this point in the history
Qa/15 21 sent card
  • Loading branch information
syb8200 authored Feb 13, 2024
2 parents 7d581b8 + e2ccd8f commit a2fefa2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,17 @@ fun SentEnvelopeScreen(
),
) {
Text(
text = stringResource(R.string.sent_envelope_card_monee_total) + uiState.envelopeInfo.totalAmounts.toMoneyFormat() +
stringResource(R.string.sent_envelope_card_money_won),
text = stringResource(R.string.sent_envelope_card_money_total, uiState.envelopeInfo.totalAmounts.toMoneyFormat()),
style = SusuTheme.typography.title_m,
color = Gray100,
)
Spacer(modifier = modifier.size(SusuTheme.spacing.spacing_xxs))
SusuBadge(
color = BadgeColor.Gray30,
text = (uiState.envelopeInfo.receivedAmounts - uiState.envelopeInfo.sentAmounts).toMoneyFormat() +
stringResource(R.string.sent_envelope_card_money_won),
text = stringResource(
R.string.sent_envelope_card_money_sent_received,
(uiState.envelopeInfo.receivedAmounts - uiState.envelopeInfo.sentAmounts).toMoneyFormat(),
),
padding = BadgeStyle.smallBadge,
)
Spacer(modifier = modifier.size(SusuTheme.spacing.spacing_xl))
Expand Down Expand Up @@ -183,12 +184,12 @@ fun SentEnvelopeScreen(
horizontalArrangement = Arrangement.SpaceBetween,
) {
Text(
text = uiState.envelopeInfo.sentAmounts.toMoneyFormat() + stringResource(R.string.sent_envelope_card_money_won),
text = stringResource(R.string.sent_envelope_card_money_sent_received, uiState.envelopeInfo.sentAmounts.toMoneyFormat()),
style = SusuTheme.typography.title_xxxxs,
color = Gray90,
)
Text(
text = uiState.envelopeInfo.receivedAmounts.toMoneyFormat() + stringResource(R.string.sent_envelope_card_money_won),
text = stringResource(R.string.sent_envelope_card_money_sent_received, uiState.envelopeInfo.receivedAmounts.toMoneyFormat()),
style = SusuTheme.typography.title_xxxxs,
color = Gray60,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.susu.core.designsystem.component.badge.BadgeColor
import com.susu.core.designsystem.component.badge.BadgeStyle
Expand All @@ -56,7 +57,10 @@ fun SentCard(
modifier = Modifier
.clip(shape = RoundedCornerShape(4.dp))
.fillMaxWidth()
.background(SusuTheme.colorScheme.background10),
.background(SusuTheme.colorScheme.background10)
.susuClickable {
onClickHistoryShowAll(state.friend.id)
},
) {
Image(
painter = painterResource(id = R.drawable.img_envelope),
Expand All @@ -71,19 +75,25 @@ fun SentCard(
Row(
verticalAlignment = Alignment.CenterVertically,
) {
Text(
text = state.friend.name,
style = SusuTheme.typography.title_xs,
color = Gray100,
)
Spacer(modifier = Modifier.size(SusuTheme.spacing.spacing_s))
SusuBadge(
color = BadgeColor.Gray20,
text = stringResource(R.string.sent_envelope_card_monee_total) + state.totalAmounts.toMoneyFormat() +
stringResource(R.string.sent_envelope_card_money_won),
padding = BadgeStyle.smallBadge,
)
Spacer(modifier = Modifier.weight(1f))
Row(
modifier = Modifier.weight(1f),
) {
Text(
text = state.friend.name,
style = SusuTheme.typography.title_xs,
color = Gray100,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.weight(1f, false),
)
Spacer(modifier = Modifier.size(SusuTheme.spacing.spacing_s))
SusuBadge(
color = BadgeColor.Gray20,
text = stringResource(R.string.sent_envelope_card_money_total, state.totalAmounts.toMoneyFormat()),
padding = BadgeStyle.smallBadge,
)
}
Spacer(modifier = Modifier.size(SusuTheme.spacing.spacing_xxs))
Icon(
painter = painterResource(id = R.drawable.ic_arrow_down),
contentDescription = stringResource(R.string.content_description_envelope_show_history),
Expand Down Expand Up @@ -132,12 +142,12 @@ fun SentCard(
horizontalArrangement = Arrangement.SpaceBetween,
) {
Text(
text = state.sentAmounts.toMoneyFormat() + stringResource(R.string.sent_envelope_card_money_won),
text = stringResource(R.string.sent_envelope_card_money_sent_received, state.sentAmounts.toMoneyFormat()),
style = SusuTheme.typography.title_xxxs,
color = Gray90,
)
Text(
text = state.receivedAmounts.toMoneyFormat() + stringResource(R.string.sent_envelope_card_money_won),
text = stringResource(R.string.sent_envelope_card_money_sent_received, state.receivedAmounts.toMoneyFormat()),
style = SusuTheme.typography.title_xxxs,
color = Gray60,
)
Expand Down
3 changes: 2 additions & 1 deletion feature/sent/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
<string name="sent_envelope_add_date_to">님에게</string>
<string name="sent_envelope_add_phone_to">"님의 "</string>
<string name="sent_envelope_add_visited_to">"을 "</string>
<string name="sent_envelope_card_monee_total">"전체 "</string>
<string name="sent_envelope_card_money_total">전체 %1$s원</string>
<string name="sent_envelope_card_money_sent_received">%1$s원</string>
<string name="sent_envelope_card_money_won">원</string>

<string name="sent_envelope_detail_delete_title">봉투를 삭제할까요?</string>
Expand Down

0 comments on commit a2fefa2

Please sign in to comment.