Skip to content

Commit

Permalink
ABW-2899 - Icon added to deposit rules content in transaction review.…
Browse files Browse the repository at this point in the history
… Icon for accept known fixed.
  • Loading branch information
raf-rdx committed Jan 31, 2024
1 parent 5121f27 commit f39fcb5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.babylon.wallet.android.presentation.account.settings.thirdpartydepos

import androidx.activity.compose.BackHandler
import androidx.annotation.DrawableRes
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand Down Expand Up @@ -300,7 +301,7 @@ fun getDepositRuleCopiesAndIcon(depositRule: Network.Account.OnLedgerSettings.Th
Triple(
stringResource(id = R.string.accountSettings_thirdPartyDeposits_onlyKnown),
stringResource(id = R.string.accountSettings_thirdPartyDeposits_onlyKnownSubtitle),
com.babylon.wallet.android.designsystem.R.drawable.ic_accept_all,
com.babylon.wallet.android.designsystem.R.drawable.ic_accept_known,
)
}

Expand Down Expand Up @@ -335,7 +336,7 @@ fun DepositOptionItem(
horizontalArrangement = Arrangement.spacedBy(RadixTheme.dimensions.paddingMedium)
) {
icon?.let {
Icon(painter = painterResource(id = it), contentDescription = null)
Image(painter = painterResource(id = it), contentDescription = null)
}
Column(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.babylon.wallet.android.presentation.transaction.composables

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -68,16 +69,31 @@ fun AccountDepositSettingsTypeContent(
AccountDefaultDepositRule.ALLOW_EXISTING -> R.string.transactionReview_accountDepositSettings_acceptKnownRule
}
).formattedSpans(boldStyle = SpanStyle(fontWeight = FontWeight.SemiBold, color = RadixTheme.colors.gray1))
val icon = when (newRule) {
AccountDefaultDepositRule.ACCEPT -> com.babylon.wallet.android.designsystem.R.drawable.ic_accept_all
AccountDefaultDepositRule.REJECT -> com.babylon.wallet.android.designsystem.R.drawable.ic_deny_all
AccountDefaultDepositRule.ALLOW_EXISTING -> com.babylon.wallet.android.designsystem.R.drawable.ic_accept_known
}
val ruleBackgroundShape =
if (accountWithSettings.onlyDepositRuleChanged) RadixTheme.shapes.roundedRectBottomMedium else RectangleShape
Text(
text = ruleText,
style = RadixTheme.typography.body1Regular,

Row(
modifier = Modifier
.background(RadixTheme.colors.gray5, shape = ruleBackgroundShape)
.padding(RadixTheme.dimensions.paddingDefault),
color = RadixTheme.colors.gray1
)
verticalAlignment = Alignment.CenterVertically
) {
Image(
modifier = Modifier.padding(end = RadixTheme.dimensions.paddingDefault),
painter = painterResource(id = icon),
contentDescription = null
)
Text(
text = ruleText,
style = RadixTheme.typography.body1Regular,
color = RadixTheme.colors.gray1
)
}
}
}
}
Expand Down

0 comments on commit f39fcb5

Please sign in to comment.