Updated on 2026-08-14

This commit is contained in:
Tangem 2026-03-03 11:21:00 +04:00
parent dff5b1f27c
commit 978d7c1da4
20 changed files with 202 additions and 855 deletions

View file

@ -6,7 +6,6 @@ import com.tangem.core.analytics.models.AnalyticsParam
import com.tangem.core.decompose.context.AppComponentContext
import com.tangem.core.decompose.navigation.Route
import com.tangem.core.ui.decompose.ComposableModularBottomSheetContentComponent
import com.tangem.domain.account.featuretoggle.AccountsFeatureToggles
import com.tangem.features.feed.components.earn.DefaultEarnComponent
import com.tangem.features.feed.components.feed.DefaultFeedComponent
import com.tangem.features.feed.components.market.details.DefaultMarketsTokenDetailsComponent
@ -20,7 +19,6 @@ import javax.inject.Inject
internal class FeedEntryChildFactory @Inject constructor(
private val analyticsEventHandler: AnalyticsEventHandler,
private val accountsFeatureToggles: AccountsFeatureToggles,
private val portfolioComponentFactory: MarketsPortfolioComponent.Factory,
private val addToPortfolioPreselectedDataComponent: AddToPortfolioPreselectedDataComponent.Factory,
) {
@ -66,7 +64,6 @@ internal class FeedEntryChildFactory @Inject constructor(
appComponentContext = appComponentContext,
params = child.params,
analyticsEventHandler = analyticsEventHandler,
accountsFeatureToggles = accountsFeatureToggles,
portfolioComponentFactory = portfolioComponentFactory,
)
}

View file

@ -15,7 +15,6 @@ import com.tangem.core.decompose.model.getOrCreateModel
import com.tangem.core.ui.components.bottomsheets.state.BottomSheetState
import com.tangem.core.ui.decompose.ComposableModularBottomSheetContentComponent
import com.tangem.core.ui.res.LocalMainBottomSheetColor
import com.tangem.domain.account.featuretoggle.AccountsFeatureToggles
import com.tangem.domain.appcurrency.model.AppCurrency
import com.tangem.domain.markets.TokenMarketParams
import com.tangem.domain.models.currency.CryptoCurrency
@ -33,7 +32,6 @@ internal class DefaultMarketsTokenDetailsComponent(
appComponentContext: AppComponentContext,
val params: Params,
analyticsEventHandler: AnalyticsEventHandler,
private val accountsFeatureToggles: AccountsFeatureToggles,
portfolioComponentFactory: MarketsPortfolioComponent.Factory,
) : ComposableModularBottomSheetContentComponent, AppComponentContext by appComponentContext {
@ -117,7 +115,6 @@ internal class DefaultMarketsTokenDetailsComponent(
modifier = modifier,
backgroundColor = LocalMainBottomSheetColor.current.value,
state = state,
isAccountEnabled = accountsFeatureToggles.isFeatureEnabled,
portfolioBlock = portfolioComponent?.let { component ->
{ blockModifier ->
component.Content(blockModifier)

View file

@ -42,7 +42,6 @@ import com.tangem.core.ui.res.TangemThemePreview
import com.tangem.domain.markets.PriceChangeInterval
import com.tangem.features.feed.impl.R
import com.tangem.features.feed.ui.market.detailed.components.*
import com.tangem.core.ui.R as CoreR
import com.tangem.features.feed.ui.market.detailed.preview.MarketsTokenDetailsPreview
import com.tangem.features.feed.ui.market.detailed.state.ExchangesBottomSheetContent
import com.tangem.features.feed.ui.market.detailed.state.InfoBottomSheetContent
@ -50,13 +49,13 @@ import com.tangem.features.feed.ui.market.detailed.state.MarketsTokenDetailsUM
import com.tangem.features.feed.ui.market.detailed.state.SecurityScoreBottomSheetContent
import kotlinx.collections.immutable.persistentListOf
import kotlinx.coroutines.flow.distinctUntilChanged
import com.tangem.core.ui.R as CoreR
@Suppress("LongParameterList")
@Composable
internal fun MarketsTokenDetailsContent(
state: MarketsTokenDetailsUM,
backgroundColor: Color,
isAccountEnabled: Boolean,
modifier: Modifier = Modifier,
portfolioBlock: @Composable ((Modifier) -> Unit)?,
) {
@ -65,7 +64,6 @@ internal fun MarketsTokenDetailsContent(
backgroundColor = backgroundColor,
state = state,
portfolioBlock = portfolioBlock,
isAccountEnabled = isAccountEnabled,
)
when (state.bottomSheetConfig.content) {
@ -80,7 +78,6 @@ internal fun MarketsTokenDetailsContent(
private fun Content(
state: MarketsTokenDetailsUM,
backgroundColor: Color,
isAccountEnabled: Boolean,
modifier: Modifier = Modifier,
portfolioBlock: @Composable ((Modifier) -> Unit)?,
) {
@ -134,7 +131,6 @@ private fun Content(
tokenMarketDetailsBody(
state = state.body,
isAccountEnabled = isAccountEnabled,
portfolioBlock = portfolioBlock,
relatedNews = state.relatedNews,
)
@ -322,7 +318,6 @@ private fun MarketsTokenDetailsContent_Preview(
state = params,
backgroundColor = TangemTheme.colors.background.tertiary,
portfolioBlock = {},
isAccountEnabled = true,
)
}
}

View file

@ -20,10 +20,9 @@ import com.tangem.features.feed.ui.feed.state.NewsSliderConfig
import com.tangem.features.feed.ui.market.detailed.state.MarketsTokenDetailsUM
import com.tangem.features.feed.ui.market.detailed.state.MarketsTokenDetailsUM.RelatedNews
@Suppress("CanBeNonNullable") // TODO will be removed after [REDACTED_JIRA]
@Suppress("CanBeNonNullable")
internal fun LazyListScope.tokenMarketDetailsBody(
state: MarketsTokenDetailsUM.Body,
isAccountEnabled: Boolean,
portfolioBlock: @Composable ((Modifier) -> Unit)?,
relatedNews: RelatedNews,
) {
@ -39,9 +38,7 @@ internal fun LazyListScope.tokenMarketDetailsBody(
}
}
if (isAccountEnabled) {
aboutCoinHeader()
}
aboutCoinHeader()
loadingInfoBlocks()
}
@ -60,9 +57,7 @@ internal fun LazyListScope.tokenMarketDetailsBody(
relatedNews(relatedNews)
}
if (isAccountEnabled) {
aboutCoinHeader()
}
aboutCoinHeader()
infoBlocksList(state.infoBlocks)
}