Updated on 2026-08-14
This commit is contained in:
parent
294c7139ee
commit
fd29bcdc08
12 changed files with 29 additions and 23 deletions
|
|
@ -51,7 +51,7 @@ fun MarketPriceBlock(state: MarketPriceBlockState, modifier: Modifier = Modifier
|
|||
verticalArrangement = Arrangement.spacedBy(TangemTheme.dimens.spacing6),
|
||||
horizontalAlignment = Alignment.Start,
|
||||
) {
|
||||
Title(currencyName = state.currencyName)
|
||||
Title(currencyName = state.currencySymbol)
|
||||
|
||||
Content(state = state, rootWidth = rootWidth)
|
||||
}
|
||||
|
|
@ -213,7 +213,7 @@ private fun Preview_MarketPriceBlock_Dark(
|
|||
private class WalletMarketPriceBlockStateProvider : CollectionPreviewParameterProvider<MarketPriceBlockState>(
|
||||
collection = listOf(
|
||||
MarketPriceBlockState.Content(
|
||||
currencyName = "BTC",
|
||||
currencySymbol = "BTC",
|
||||
price = "98900 $",
|
||||
priceChangeConfig = PriceChangeState.Content(
|
||||
valueInPercent = "5.16%",
|
||||
|
|
@ -221,14 +221,14 @@ private class WalletMarketPriceBlockStateProvider : CollectionPreviewParameterPr
|
|||
),
|
||||
),
|
||||
MarketPriceBlockState.Content(
|
||||
currencyName = "BTC",
|
||||
currencySymbol = "BTC",
|
||||
price = "98900 $",
|
||||
priceChangeConfig = PriceChangeState.Content(
|
||||
valueInPercent = "10.89%",
|
||||
type = PriceChangeType.UP,
|
||||
),
|
||||
),
|
||||
MarketPriceBlockState.Loading(currencyName = "BTC"),
|
||||
MarketPriceBlockState.Error(currencyName = "BTC"),
|
||||
MarketPriceBlockState.Loading(currencySymbol = "BTC"),
|
||||
MarketPriceBlockState.Error(currencySymbol = "BTC"),
|
||||
),
|
||||
)
|
||||
|
|
@ -5,14 +5,14 @@ import androidx.compose.runtime.Immutable
|
|||
@Immutable
|
||||
sealed interface MarketPriceBlockState {
|
||||
|
||||
val currencyName: String
|
||||
val currencySymbol: String
|
||||
|
||||
data class Error(override val currencyName: String) : MarketPriceBlockState
|
||||
data class Error(override val currencySymbol: String) : MarketPriceBlockState
|
||||
|
||||
data class Loading(override val currencyName: String) : MarketPriceBlockState
|
||||
data class Loading(override val currencySymbol: String) : MarketPriceBlockState
|
||||
|
||||
data class Content(
|
||||
override val currencyName: String,
|
||||
override val currencySymbol: String,
|
||||
val price: String,
|
||||
val priceChangeConfig: PriceChangeState.Content,
|
||||
) : MarketPriceBlockState
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue