Skip to content

Commit

Permalink
Show swap icon for Swap Price cell in TransactionInfo page
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelekol committed Apr 1, 2024
1 parent acad141 commit 9b5c5d0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ fun TransactionInfoSection(

is TransactionInfoViewItem.Value -> {
add {
TitleAndValueCell(title = viewItem.title, value = viewItem.value)
TitleAndValueCell(
title = viewItem.title,
value = viewItem.value,
valueIcon = viewItem.valueIcon
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sealed class TransactionInfoViewItem {
val badge: String?,
) : TransactionInfoViewItem()

class Value(val title: String, val value: String) : TransactionInfoViewItem()
class Value(val title: String, val value: String, val valueIcon: Int? = null) : TransactionInfoViewItem()

class Address(val title: String, val value: String, val showAdd: Boolean, val blockchainType: BlockchainType) : TransactionInfoViewItem()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,8 @@ class TransactionInfoViewItemFactory(
items.add(
Value(
getString(R.string.TransactionInfo_Price),
priceValue
priceValue,
R.drawable.ic_arrow_swap3_20
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,23 @@ fun TransactionAmountCell(
@Composable
fun TitleAndValueCell(
title: String,
value: String
value: String,
valueIcon: Int? = null
) {
RowUniversal(
modifier = Modifier.padding(horizontal = 16.dp),
) {
subhead2_grey(text = title, modifier = Modifier.padding(end = 16.dp))
Spacer(Modifier.weight(1f))
subhead1_leah(text = value, maxLines = 1, overflow = TextOverflow.Ellipsis)
valueIcon?.let {
HSpacer(8.dp)
Icon(
painter = painterResource(valueIcon),
contentDescription = null,
tint = ComposeAppTheme.colors.grey
)
}
}
}

Expand Down

0 comments on commit 9b5c5d0

Please sign in to comment.