Updated on 2026-08-14
This commit is contained in:
parent
d792ac6304
commit
6de57d6545
18 changed files with 367 additions and 21 deletions
|
|
@ -19,6 +19,7 @@ import com.tangem.domain.markets.PreselectedMarketsInterval
|
|||
import com.tangem.domain.markets.PreselectedMarketsOrder
|
||||
import com.tangem.domain.markets.TokenMarketParams
|
||||
import com.tangem.domain.models.earn.PreselectedEarnType
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.domain.news.model.NewsListConfig
|
||||
import com.tangem.features.feed.components.earn.DefaultEarnComponent
|
||||
import com.tangem.features.feed.components.market.details.DefaultMarketsTokenDetailsComponent
|
||||
|
|
@ -32,6 +33,7 @@ import com.tangem.features.feed.model.feed.FeedModelClickIntents
|
|||
import com.tangem.features.feed.model.market.list.state.MarketsListUM
|
||||
import com.tangem.features.feed.model.market.list.state.SortByTypeUM
|
||||
import com.tangem.features.feed.ui.EntryContent
|
||||
import com.tangem.features.foryou.TokenSummaryComponent
|
||||
import dagger.assisted.Assisted
|
||||
import dagger.assisted.AssistedFactory
|
||||
import dagger.assisted.AssistedInject
|
||||
|
|
@ -146,6 +148,15 @@ internal class DefaultFeedEntryComponent @AssistedInject constructor(
|
|||
override fun openForYou() {
|
||||
stackNavigation.bringToFront(FeedEntryChildFactory.Child.ForYou)
|
||||
}
|
||||
|
||||
override fun openTokenSummary(userWalletId: UserWalletId, token: TokenSummaryComponent.Token) {
|
||||
innerRouter.push(
|
||||
FeedEntryChildFactory.Child.TokenSummary(
|
||||
userWalletId = userWalletId,
|
||||
token = token,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private val stack: Value<ChildStack<FeedEntryChildFactory.Child, ComposableModularBottomSheetContentComponent>> =
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.tangem.core.decompose.context.AppComponentContext
|
|||
import com.tangem.core.decompose.navigation.Route
|
||||
import com.tangem.core.ui.DesignFeatureToggles
|
||||
import com.tangem.core.ui.decompose.ComposableModularBottomSheetContentComponent
|
||||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.features.commonfeatures.api.addtoportfolio.AddToPortfolioComponent
|
||||
import com.tangem.features.commonfeatures.api.managefunds.ManageFundsComponent
|
||||
import com.tangem.features.feed.components.earn.DefaultEarnComponent
|
||||
|
|
@ -21,6 +23,7 @@ import com.tangem.features.feed.components.news.list.DefaultNewsListComponent
|
|||
import com.tangem.features.feed.components.search.DefaultSearchComponent
|
||||
import com.tangem.features.feed.model.market.list.state.SortByTypeUM
|
||||
import com.tangem.features.foryou.ForYouComponent
|
||||
import com.tangem.features.foryou.TokenSummaryComponent
|
||||
import com.tangem.features.promobanners.api.PromoBannersBlockComponent
|
||||
import kotlinx.serialization.Serializable
|
||||
import javax.inject.Inject
|
||||
|
|
@ -35,6 +38,7 @@ internal class FeedEntryChildFactory @Inject constructor(
|
|||
private val promoBannersBlockComponentFactory: PromoBannersBlockComponent.Factory,
|
||||
private val designFeatureToggles: DesignFeatureToggles,
|
||||
private val forYouComponentFactory: ForYouComponent.Factory,
|
||||
private val tokenSummaryComponentFactory: TokenSummaryComponent.Factory,
|
||||
) {
|
||||
|
||||
@Serializable
|
||||
|
|
@ -72,6 +76,13 @@ internal class FeedEntryChildFactory @Inject constructor(
|
|||
@Serializable
|
||||
@Immutable
|
||||
data object ForYou : Child
|
||||
|
||||
@Serializable
|
||||
@Immutable
|
||||
data class TokenSummary(
|
||||
val userWalletId: UserWalletId,
|
||||
val token: TokenSummaryComponent.Token,
|
||||
) : Child
|
||||
}
|
||||
|
||||
@Suppress("LongMethod")
|
||||
|
|
@ -155,7 +166,26 @@ internal class FeedEntryChildFactory @Inject constructor(
|
|||
)
|
||||
Child.ForYou -> forYouComponentFactory.create(
|
||||
context = appComponentContext,
|
||||
params = Unit,
|
||||
params = ForYouComponent.Params(
|
||||
callbacks = object : ForYouComponent.ForYouModelCallbacks {
|
||||
override fun onTokenClick(userWalletId: UserWalletId, currency: CryptoCurrency) {
|
||||
feedEntryClickIntents.openTokenSummary(
|
||||
userWalletId = userWalletId,
|
||||
token = TokenSummaryComponent.Token.Portfolio(currency),
|
||||
)
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
is Child.TokenSummary -> tokenSummaryComponentFactory.create(
|
||||
context = appComponentContext,
|
||||
params = TokenSummaryComponent.Params(
|
||||
userWalletId = child.userWalletId,
|
||||
token = child.token,
|
||||
callbacks = object : TokenSummaryComponent.TokenSummaryModelCallbacks {
|
||||
override fun onDismiss() = onBackClicked()
|
||||
},
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@ package com.tangem.features.feed.model.feed
|
|||
import com.tangem.core.analytics.models.AnalyticsParam
|
||||
import com.tangem.domain.appcurrency.model.AppCurrency
|
||||
import com.tangem.domain.markets.TokenMarketParams
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.domain.news.model.NewsListConfig
|
||||
import com.tangem.features.feed.model.market.list.state.SortByTypeUM
|
||||
import com.tangem.features.foryou.TokenSummaryComponent
|
||||
|
||||
/**
|
||||
* Callback interface for feed model navigation actions.
|
||||
|
|
@ -33,4 +35,6 @@ internal interface FeedModelClickIntents {
|
|||
fun openSearch(source: String)
|
||||
|
||||
fun openForYou()
|
||||
|
||||
fun openTokenSummary(userWalletId: UserWalletId, token: TokenSummaryComponent.Token)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue