Updated on 2026-08-14
This commit is contained in:
parent
b2616969b4
commit
868fe24c75
4 changed files with 16 additions and 6 deletions
|
|
@ -12,6 +12,7 @@ data class NFTAssetUM(
|
|||
val media: Media,
|
||||
val topInfo: TopInfo,
|
||||
val traits: ImmutableList<BlockItem>,
|
||||
val showAllTraitsButton: Boolean,
|
||||
val baseInfoItems: ImmutableList<BlockItem>,
|
||||
) {
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ internal class NFTDetailsUMFactory(
|
|||
value = it.value,
|
||||
)
|
||||
}.toImmutableList(),
|
||||
showAllTraitsButton = traits.size > MAX_TRAITS_COUNT,
|
||||
baseInfoItems = buildBaseInfoItems(),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -70,12 +70,16 @@ internal fun NFTDetailsAsset(
|
|||
.padding(top = TangemTheme.dimens.spacing12),
|
||||
items = state.traits,
|
||||
title = resourceReference(R.string.nft_details_traits),
|
||||
action = {
|
||||
NFTBlocksGroupAction(
|
||||
text = resourceReference(R.string.common_see_all),
|
||||
startIcon = { },
|
||||
onClick = onSeeAllTraitsClick,
|
||||
)
|
||||
action = if (state.showAllTraitsButton) {
|
||||
{
|
||||
NFTBlocksGroupAction(
|
||||
text = resourceReference(R.string.common_see_all),
|
||||
startIcon = { },
|
||||
onClick = onSeeAllTraitsClick,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
null
|
||||
},
|
||||
)
|
||||
NFTDetailsBlocksGroup(
|
||||
|
|
@ -162,6 +166,7 @@ private class NFTAssetProvider : CollectionPreviewParameterProvider<NFTAssetUM>(
|
|||
value = "DJ Dragoon",
|
||||
),
|
||||
),
|
||||
showAllTraitsButton = true,
|
||||
baseInfoItems = persistentListOf(
|
||||
NFTAssetUM.BlockItem(
|
||||
title = resourceReference(R.string.nft_details_token_standard),
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.tangem.features.nft.traits.ui
|
|||
|
||||
import android.content.res.Configuration
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
|
|
@ -23,6 +24,7 @@ import kotlinx.collections.immutable.persistentListOf
|
|||
internal fun NFTAssetTraitsContent(state: NFTAssetTraitsUM, modifier: Modifier = Modifier) {
|
||||
InformationBlock(
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.padding(TangemTheme.dimens.spacing16),
|
||||
title = null,
|
||||
contentHorizontalPadding = 0.dp,
|
||||
|
|
@ -35,6 +37,7 @@ internal fun NFTAssetTraitsContent(state: NFTAssetTraitsUM, modifier: Modifier =
|
|||
key(trait.id) {
|
||||
NFTAssetTrait(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(
|
||||
horizontal = TangemTheme.dimens.spacing12,
|
||||
vertical = TangemTheme.dimens.spacing8,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue