Updated on 2026-08-14

This commit is contained in:
Tangem 2025-11-14 18:25:36 +05:00
parent 804ea2b1b0
commit 4e10a0c4ca
15 changed files with 65 additions and 38 deletions

View file

@ -94,7 +94,8 @@ internal fun YieldSupplyActionContent(
YieldSupplyFeeRow(
title = resourceReference(R.string.common_network_fee_title),
value = fee,
modifier = Modifier.fillMaxWidth()
modifier = Modifier
.fillMaxWidth()
.clip(RoundedCornerShape(14.dp))
.background(TangemTheme.colors.background.action)
.padding(horizontal = 16.dp, vertical = 12.dp),
@ -139,7 +140,10 @@ private class YieldSupplyActionContentPreviewProvider : PreviewParameterProvider
R.string.yield_module_start_earning_sheet_description,
wrappedList("USDT"),
),
footer = resourceReference(R.string.yield_module_start_earning_sheet_next_deposits),
footer = resourceReference(
R.string.yield_module_start_earning_sheet_next_deposits_v2,
wrappedList("USDT"),
),
footerLink = resourceReference(R.string.yield_module_start_earning_sheet_fee_policy),
currencyIconState = CurrencyIconState.Loading,
yieldSupplyFeeUM = YieldSupplyFeeUM.Content(

View file

@ -55,8 +55,9 @@ internal fun YieldSupplyBlockContent(yieldSupplyUM: YieldSupplyUM, modifier: Mod
resourceReference(R.string.yield_module_stop_earning),
modifier,
)
YieldSupplyUM.Unavailable -> SupplyUnavailable(modifier)
YieldSupplyUM.Initial -> Unit
YieldSupplyUM.Unavailable,
YieldSupplyUM.Initial,
-> Unit
}
}
}
@ -80,18 +81,6 @@ private fun SupplyAvailable(supplyUM: YieldSupplyUM.Available, modifier: Modifie
)
}
@Composable
private fun SupplyUnavailable(modifier: Modifier = Modifier) {
SupplyInfo(
title = resourceReference(R.string.yield_module_unavailable_title),
subtitle = resourceReference(R.string.yield_module_unavailable_subtitle),
rewardsApy = null,
iconTint = TangemTheme.colors.icon.inactive,
button = null,
modifier = modifier,
)
}
@Suppress("LongMethod")
@Composable
private fun SupplyContent(supplyUM: YieldSupplyUM.Content, modifier: Modifier = Modifier) {

View file

@ -7,4 +7,5 @@ data class YieldSupplyPromoUM(
val policyLink: String,
val title: TextReference,
val subtitle: TextReference,
val tokenSymbol: String,
)

View file

@ -34,6 +34,7 @@ internal class YieldSupplyPromoModel @Inject constructor(
val uiState: YieldSupplyPromoUM = YieldSupplyPromoUM(
tosLink = TangemBlogUrlBuilder.YIELD_SUPPLY_TOS_URL,
policyLink = TangemBlogUrlBuilder.YIELD_SUPPLY_PRIVACY_URL,
tokenSymbol = params.currency.symbol,
title = resourceReference(R.string.yield_module_promo_screen_title),
subtitle = resourceReference(
R.string.yield_module_promo_screen_variable_rate_info,

View file

@ -113,7 +113,7 @@ private fun ColumnScope.Content(yieldSupplyPromoUM: YieldSupplyPromoUM, clickInt
),
)
SpacerH32()
PromoItems()
PromoItems(yieldSupplyPromoUM.tokenSymbol)
}
SpacerH32()
}
@ -151,7 +151,7 @@ private fun YieldStatusAppBar(onBackClick: () -> Unit, onHowItWorksClick: () ->
}
@Composable
private fun PromoItems() {
private fun PromoItems(tokenSymbol: String) {
PromoItem(
icon = R.drawable.ic_flash_new_24,
title = resourceReference(R.string.yield_module_promo_screen_cash_out_title),
@ -161,7 +161,10 @@ private fun PromoItems() {
PromoItem(
icon = R.drawable.ic_repeat_24,
title = resourceReference(R.string.yield_module_promo_screen_auto_balance_title),
subtitle = resourceReference(R.string.yield_module_promo_screen_auto_balance_subtitle),
subtitle = resourceReference(
R.string.yield_module_promo_screen_auto_balance_subtitle_v2,
wrappedList(tokenSymbol),
),
)
SpacerH24()
PromoItem(
@ -258,6 +261,7 @@ private fun YieldSupplyPromoContent_Preview() {
tosLink = "https://tangem.com/terms-of-service/",
policyLink = "https://tangem.com/privacy-policy/",
title = resourceReference(R.string.yield_module_promo_screen_title),
tokenSymbol = "USDT",
subtitle = resourceReference(R.string.yield_module_promo_screen_variable_rate_info, wrappedList("5.3")),
),
clickIntents = object : YieldSupplyPromoClickIntents {

View file

@ -58,7 +58,7 @@ internal class YieldSupplyActiveComponent(
@Composable
override fun Footer() {
SecondaryButton(
text = stringResourceSafe(R.string.yield_module_stop_earning),
text = stringResourceSafe(R.string.yield_module_disable_button),
onClick = params.callback::onStopEarning,
modifier = Modifier
.fillMaxWidth()

View file

@ -40,7 +40,10 @@ internal class YieldSupplyStartEarningEntryModel @Inject constructor(
R.string.yield_module_start_earning_sheet_description,
wrappedList(params.cryptoCurrency.symbol),
),
footer = resourceReference(R.string.yield_module_start_earning_sheet_next_deposits),
footer = resourceReference(
R.string.yield_module_start_earning_sheet_next_deposits_v2,
wrappedList(params.cryptoCurrency.symbol),
),
footerLink = resourceReference(R.string.yield_module_start_earning_sheet_fee_policy),
currencyIconState = CryptoCurrencyToIconStateConverter().convert(params.cryptoCurrency),
yieldSupplyFeeUM = YieldSupplyFeeUM.Loading,

View file

@ -45,7 +45,7 @@ import java.math.BigDecimal
import javax.inject.Inject
import kotlin.properties.Delegates
@Suppress("LongParameterList")
@Suppress("LongParameterList", "LargeClass")
@ModelScoped
internal class YieldSupplyStartEarningModel @Inject constructor(
override val dispatchers: CoroutineDispatcherProvider,
@ -96,7 +96,10 @@ internal class YieldSupplyStartEarningModel @Inject constructor(
R.string.yield_module_start_earning_sheet_description,
wrappedList(cryptoCurrency.symbol),
),
footer = resourceReference(R.string.yield_module_start_earning_sheet_next_deposits),
footer = resourceReference(
R.string.yield_module_start_earning_sheet_next_deposits_v2,
wrappedList(cryptoCurrency.symbol),
),
footerLink = resourceReference(R.string.yield_module_start_earning_sheet_fee_policy),
currencyIconState = CryptoCurrencyToIconStateConverter().convert(params.cryptoCurrency),
yieldSupplyFeeUM = YieldSupplyFeeUM.Loading,