diff --git a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/detailed/components/InfoPoint.kt b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/detailed/components/InfoPoint.kt index 4baddf7c1a..e8fff6971a 100644 --- a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/detailed/components/InfoPoint.kt +++ b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/detailed/components/InfoPoint.kt @@ -2,11 +2,14 @@ package com.tangem.features.feed.ui.market.detailed.components import android.content.res.Configuration import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.* import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.ImageVector @@ -19,6 +22,7 @@ import com.tangem.core.ui.components.RectangleShimmer import com.tangem.core.ui.components.SpacerW4 import com.tangem.core.ui.components.TextShimmer import com.tangem.core.ui.components.text.TooltipText +import com.tangem.core.ui.extensions.conditional import com.tangem.core.ui.extensions.resolveReference import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.res.LocalRedesignEnabled @@ -89,8 +93,19 @@ private fun InfoPointV1(infoPointUM: InfoPointUM, modifier: Modifier = Modifier) @Composable private fun InfoPointV2(infoPointUM: InfoPointUM, modifier: Modifier = Modifier) { + val interactionSource = remember { MutableInteractionSource() } Column( - modifier = modifier.padding(vertical = TangemTheme.dimens.spacing8), + modifier = modifier + .conditional( + condition = infoPointUM.onInfoClick != null, + modifier = { + clickable( + interactionSource = interactionSource, + onClick = { infoPointUM.onInfoClick?.invoke() }, + ) + }, + ) + .padding(vertical = TangemTheme.dimens.spacing8), horizontalAlignment = Alignment.Start, verticalArrangement = Arrangement.spacedBy(4.dp), ) { diff --git a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/detailed/components/MetricsCards.kt b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/detailed/components/MetricsCards.kt index 04ac27ab73..7bfdefee9c 100644 --- a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/detailed/components/MetricsCards.kt +++ b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/detailed/components/MetricsCards.kt @@ -41,6 +41,7 @@ import com.tangem.features.feed.ui.market.detailed.state.TrendingVolumeLiquidity @Composable internal fun MarketCapCard(item: InfoPointUMV2.MarketCap) { MetricsCard( + onClick = item.onInfoClick, modifier = Modifier .heightIn(104.dp) .fillMaxWidth(), @@ -68,6 +69,7 @@ internal fun TradingVolumeCard(item: InfoPointUMV2.TradingVolume) { modifier = Modifier .heightIn(104.dp) .fillMaxWidth(), + onClick = item.onInfoClick, title = { Row { MetricValueText(item.tradingValue) @@ -113,6 +115,7 @@ internal fun MarketPositionCard(item: InfoPointUMV2.MarketPosition) { modifier = Modifier .heightIn(104.dp) .fillMaxWidth(), + onClick = item.onInfoClick, title = { Row(verticalAlignment = Alignment.CenterVertically) { MarketPositionValue(position = item.position, ratingColor = ratingColor) @@ -151,6 +154,7 @@ internal fun FDVCard(item: InfoPointUMV2.FullyDilutedValuation) { modifier = Modifier .heightIn(104.dp) .fillMaxWidth(), + onClick = item.onInfoClick, title = { if (item.fullyDilutedValuationChange24 != null) { Row { diff --git a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/detailed/components/SecurityScoreBlock.kt b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/detailed/components/SecurityScoreBlock.kt index ed8956d257..9ef7769693 100644 --- a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/detailed/components/SecurityScoreBlock.kt +++ b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/detailed/components/SecurityScoreBlock.kt @@ -2,6 +2,7 @@ package com.tangem.features.feed.ui.market.detailed.components import android.content.res.Configuration import androidx.compose.foundation.background +import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -81,7 +82,7 @@ private fun SecurityScoreBlockV1(state: SecurityScoreUM, modifier: Modifier = Mo @Composable private fun SecurityScoreBlockV2(state: SecurityScoreUM, modifier: Modifier = Modifier) { TokenMarketInformationBlock( - modifier = modifier, + modifier = modifier.clickable(onClick = state.onInfoClick), title = { TangemRowContainer(contentPadding = PaddingValues()) { Text(