diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/AddCustomTokenUM.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/AddCustomTokenUM.kt deleted file mode 100644 index a34939d61f..0000000000 --- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/AddCustomTokenUM.kt +++ /dev/null @@ -1,54 +0,0 @@ -package com.tangem.features.managetokens.entity - -import androidx.compose.runtime.Immutable -import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfigContent -import com.tangem.domain.tokens.model.Network - -@Immutable -internal sealed class AddCustomTokenUM : TangemBottomSheetConfigContent { - - abstract val selectedNetwork: SelectedNetworkUM? - abstract val addTokenButton: AddCustomTokenButtonUM - - abstract val popBack: () -> Unit - - data class NetworkSelector( - override val selectedNetwork: SelectedNetworkUM? = null, - override val popBack: () -> Unit, - ) : AddCustomTokenUM() { - - override val addTokenButton: AddCustomTokenButtonUM = AddCustomTokenButtonUM.Hidden - } - - data class Form( - override val selectedNetwork: SelectedNetworkUM, - override val addTokenButton: AddCustomTokenButtonUM.Visible, - override val popBack: () -> Unit, - ) : AddCustomTokenUM() -} - -@Immutable -internal data class SelectedNetworkUM( - val id: Network.ID, - val name: String, -) - -@Immutable -internal sealed class AddCustomTokenButtonUM { - - open val onClick: () -> Unit = {} - - open val isEnabled: Boolean = false - - val isVisible: Boolean - get() = this is Visible - - data object Hidden : AddCustomTokenButtonUM() { - override val onClick: () -> Unit = {} - } - - data class Visible( - override val isEnabled: Boolean, - override val onClick: () -> Unit, - ) : AddCustomTokenButtonUM() -} \ No newline at end of file diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/CustomTokenNetworkSelectorUM.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/CustomTokenNetworkSelectorUM.kt deleted file mode 100644 index 1435d25f7d..0000000000 --- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/CustomTokenNetworkSelectorUM.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.tangem.features.managetokens.entity - -import androidx.compose.runtime.Immutable -import kotlinx.collections.immutable.ImmutableList - -@Immutable -internal data class CustomTokenNetworkSelectorUM( - val showTitle: Boolean, - val networks: ImmutableList, -) \ No newline at end of file diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/customtoken/AddCustomTokenConfig.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/customtoken/AddCustomTokenConfig.kt new file mode 100644 index 0000000000..49367133b5 --- /dev/null +++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/customtoken/AddCustomTokenConfig.kt @@ -0,0 +1,37 @@ +package com.tangem.features.managetokens.entity.customtoken + +import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfigContent +import com.tangem.core.ui.extensions.TextReference +import com.tangem.domain.tokens.model.Network +import com.tangem.domain.wallets.models.UserWalletId +import kotlinx.serialization.Serializable + +@Serializable +internal data class AddCustomTokenConfig( + val step: Step, + val popBack: () -> Unit, + val userWalletId: UserWalletId, + val selectedNetwork: SelectedNetwork? = null, + val selectedDerivationPath: SelectedDerivationPath? = null, +) : TangemBottomSheetConfigContent { + + enum class Step { + INITIAL_NETWORK_SELECTOR, + NETWORK_SELECTOR, + DERIVATION_PATH_SELECTOR, + FORM, + } +} + +@Serializable +internal data class SelectedNetwork( + val id: Network.ID, + val name: TextReference, + val derivationPath: String, +) + +@Serializable +internal data class SelectedDerivationPath( + val value: String, + val name: TextReference, +) \ No newline at end of file diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/customtoken/CustomTokenSelectorUM.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/customtoken/CustomTokenSelectorUM.kt new file mode 100644 index 0000000000..25c08fac10 --- /dev/null +++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/customtoken/CustomTokenSelectorUM.kt @@ -0,0 +1,23 @@ +package com.tangem.features.managetokens.entity.customtoken + +import androidx.compose.runtime.Immutable +import com.tangem.features.managetokens.entity.item.SelectableItemUM +import kotlinx.collections.immutable.ImmutableList + +internal data class CustomTokenSelectorUM( + val header: HeaderUM, + val items: ImmutableList, +) { + + @Immutable + sealed class HeaderUM { + + data object None : HeaderUM() + + data object Description : HeaderUM() + + data class CustomDerivationButton( + val onClick: () -> Unit, + ) : HeaderUM() + } +} \ No newline at end of file