Updated on 2026-08-14
This commit is contained in:
parent
46bf08cb8b
commit
e94298dd23
48 changed files with 68 additions and 2 deletions
|
|
@ -145,7 +145,7 @@ dependencies {
|
|||
implementation(projects.features.referral.domain)
|
||||
implementation(projects.features.referral.data)
|
||||
implementation(projects.features.swap.api)
|
||||
implementation(projects.features.swap.presentation)
|
||||
implementation(projects.features.swap.impl)
|
||||
implementation(projects.features.swap.domain)
|
||||
implementation(projects.features.swap.domain.api)
|
||||
implementation(projects.features.swap.data)
|
||||
|
|
|
|||
|
|
@ -7,4 +7,14 @@ plugins {
|
|||
|
||||
android {
|
||||
namespace = "com.tangem.features.swap.api"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
/** Project - Core */
|
||||
implementation(projects.core.decompose)
|
||||
implementation(projects.core.ui)
|
||||
|
||||
/** Project - Domain */
|
||||
implementation(projects.domain.tokens.models)
|
||||
implementation(projects.domain.wallets.models)
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.tangem.features.swap
|
||||
|
||||
import com.tangem.core.decompose.factory.ComponentFactory
|
||||
import com.tangem.core.ui.decompose.ComposableContentComponent
|
||||
import com.tangem.domain.tokens.model.CryptoCurrency
|
||||
import com.tangem.domain.wallets.models.UserWalletId
|
||||
|
||||
interface SwapComponent : ComposableContentComponent {
|
||||
|
||||
data class Params(
|
||||
val currencyFrom: CryptoCurrency,
|
||||
val currencyTo: CryptoCurrency? = null,
|
||||
val userWalletId: UserWalletId,
|
||||
val isInitialReverseOrder: Boolean = false,
|
||||
)
|
||||
|
||||
interface Factory : ComponentFactory<Params, SwapComponent>
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.tangem.feature.swap
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import com.tangem.core.decompose.context.AppComponentContext
|
||||
import com.tangem.features.swap.SwapComponent
|
||||
import dagger.assisted.Assisted
|
||||
import dagger.assisted.AssistedFactory
|
||||
import dagger.assisted.AssistedInject
|
||||
|
||||
@Suppress("UnusedPrivateMember")
|
||||
internal class DefaultSwapComponent @AssistedInject constructor(
|
||||
@Assisted appComponentContext: AppComponentContext,
|
||||
@Assisted params: SwapComponent.Params,
|
||||
) : SwapComponent, AppComponentContext by appComponentContext {
|
||||
|
||||
@Composable
|
||||
override fun Content(modifier: Modifier) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
@AssistedFactory
|
||||
interface Factory : SwapComponent.Factory {
|
||||
override fun create(context: AppComponentContext, params: SwapComponent.Params): DefaultSwapComponent
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,11 @@
|
|||
package com.tangem.feature.swap.di
|
||||
|
||||
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
|
||||
import com.tangem.feature.swap.DefaultSwapComponent
|
||||
import com.tangem.feature.swap.DefaultSwapFeatureToggles
|
||||
import com.tangem.features.swap.SwapComponent
|
||||
import com.tangem.features.swap.SwapFeatureToggles
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
|
|
@ -18,4 +21,13 @@ internal object SwapFeatureModule {
|
|||
fun provideSwapFeatureToggles(featureToggles: FeatureTogglesManager): SwapFeatureToggles {
|
||||
return DefaultSwapFeatureToggles(featureToggles)
|
||||
}
|
||||
}
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
internal interface SwapFeatureModuleBinds {
|
||||
|
||||
@Binds
|
||||
@Singleton
|
||||
fun provideSwapComponentFactory(impl: DefaultSwapComponent.Factory): SwapComponent.Factory
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
|
@ -165,7 +165,7 @@ include(":features:swap:data")
|
|||
include(":features:swap:domain")
|
||||
include(":features:swap:domain:models")
|
||||
include(":features:swap:domain:api")
|
||||
include(":features:swap:presentation")
|
||||
include(":features:swap:impl")
|
||||
|
||||
include(":features:tester:api")
|
||||
include(":features:tester:impl")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue