Updated on 2026-08-14

This commit is contained in:
Tangem 2025-10-16 15:00:44 +05:00
parent 8c93a8b820
commit e2247020e4
9 changed files with 71 additions and 36 deletions

View file

@ -13,6 +13,8 @@ dependencies {
implementation(projects.core.decompose)
implementation(projects.core.ui)
api(projects.features.sendV2.api)
/** Common */
implementation(projects.common.ui)

View file

@ -4,6 +4,8 @@ import com.tangem.core.decompose.factory.ComponentFactory
import com.tangem.core.ui.decompose.ComposableContentComponent
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.features.send.v2.api.entry.SendEntryRoute
import kotlinx.coroutines.flow.StateFlow
interface SendWithSwapComponent : ComposableContentComponent {
@ -11,6 +13,7 @@ interface SendWithSwapComponent : ComposableContentComponent {
val userWalletId: UserWalletId,
val currency: CryptoCurrency,
val callback: ModelCallback? = null,
val currentRoute: StateFlow<SendEntryRoute>,
)
interface Factory : ComponentFactory<Params, SendWithSwapComponent>

View file

@ -23,6 +23,7 @@ import com.tangem.core.ui.extensions.resourceReference
import com.tangem.domain.swap.models.R
import com.tangem.domain.swap.models.SwapDirection
import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents
import com.tangem.features.send.v2.api.entry.SendEntryRoute
import com.tangem.features.send.v2.api.subcomponents.destination.DestinationRoute
import com.tangem.features.send.v2.api.subcomponents.destination.SendDestinationComponent
import com.tangem.features.send.v2.api.subcomponents.destination.SendDestinationComponentParams
@ -85,12 +86,17 @@ internal class DefaultSendWithSwapComponent @AssistedInject constructor(
componentScope.launch {
when (val activeComponent = stack.active.instance) {
is SwapAmountComponent -> {
analyticsEventHandler.send(
CommonSendAnalyticEvents.AmountScreenOpened(
categoryName = model.analyticCategoryName,
source = model.analyticsSendSource,
),
)
if (
params.currentRoute.value is SendEntryRoute.SendWithSwap &&
model.currentRoute.value != stack.active.configuration
) {
analyticsEventHandler.send(
CommonSendAnalyticEvents.AmountScreenOpened(
categoryName = model.analyticCategoryName,
source = model.analyticsSendSource,
),
)
}
activeComponent.updateState(model.uiState.value.amountUM)
}
is SendDestinationComponent -> {