Updated on 2026-08-14
This commit is contained in:
parent
8c93a8b820
commit
e2247020e4
9 changed files with 71 additions and 36 deletions
|
|
@ -13,6 +13,8 @@ dependencies {
|
|||
implementation(projects.core.decompose)
|
||||
implementation(projects.core.ui)
|
||||
|
||||
api(projects.features.sendV2.api)
|
||||
|
||||
/** Common */
|
||||
implementation(projects.common.ui)
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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 -> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue