diff --git a/app/src/main/java/com/tangem/tap/common/pushes/TangemPushNotificationService.kt b/app/src/main/java/com/tangem/tap/common/pushes/TangemPushNotificationService.kt index 23a6725255..ea9a016793 100644 --- a/app/src/main/java/com/tangem/tap/common/pushes/TangemPushNotificationService.kt +++ b/app/src/main/java/com/tangem/tap/common/pushes/TangemPushNotificationService.kt @@ -17,6 +17,7 @@ import com.google.firebase.messaging.FirebaseMessagingService import com.google.firebase.messaging.RemoteMessage import com.tangem.core.deeplink.DEEPLINK_KEY import com.tangem.core.deeplink.WEBLINK_KEY +import com.tangem.core.deeplink.converter.PayloadToDeeplinkConverter import com.tangem.domain.common.LogConfig import com.tangem.tap.MainActivity import com.tangem.tap.common.images.createCoilImageLoader @@ -37,9 +38,10 @@ internal class TangemPushNotificationService : FirebaseMessagingService() { val notification = message.notification ?: return val channelId = notification.channelId ?: TANGEM_CHANNEL_ID + val deeplink = PayloadToDeeplinkConverter.convert(message.data) val intent = Intent(applicationContext, MainActivity::class.java).apply { - putExtra(DEEPLINK_KEY, message.data[DEEPLINK_KEY]) + putExtra(DEEPLINK_KEY, deeplink) putExtra(WEBLINK_KEY, message.data[WEBLINK_KEY]) putExtra(OnPushClickedIntentHandler.OPENED_FROM_GCM_PUSH, true) addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) diff --git a/core/datasource/src/main/java/com/tangem/datasource/api/tangemTech/models/NotificationApplicationCreateBody.kt b/core/datasource/src/main/java/com/tangem/datasource/api/tangemTech/models/NotificationApplicationCreateBody.kt index fdc296f8c1..cd8e66f46e 100644 --- a/core/datasource/src/main/java/com/tangem/datasource/api/tangemTech/models/NotificationApplicationCreateBody.kt +++ b/core/datasource/src/main/java/com/tangem/datasource/api/tangemTech/models/NotificationApplicationCreateBody.kt @@ -9,6 +9,7 @@ data class NotificationApplicationCreateBody( @Json(name = "platform") val platform: String? = null, @Json(name = "device") val device: String? = null, @Json(name = "systemVersion") val systemVersion: String? = null, + @Json(name = "version") val version: String? = null, @Json(name = "language") val language: String? = null, @Json(name = "timezone") val timezone: String? = null, ) \ No newline at end of file diff --git a/core/deep-links/build.gradle.kts b/core/deep-links/build.gradle.kts index c086d8f8d6..dd23856660 100644 --- a/core/deep-links/build.gradle.kts +++ b/core/deep-links/build.gradle.kts @@ -10,6 +10,9 @@ android { } dependencies { + /* Common */ + implementation(projects.common.routing) + /* Core */ implementation(projects.core.decompose) @@ -22,4 +25,10 @@ dependencies { /* DI */ implementation(deps.hilt.android) kapt(deps.hilt.kapt) + + /* Tests */ + testImplementation(deps.test.junit) + testImplementation(deps.test.coroutine) + testImplementation(deps.test.truth) + testImplementation(deps.test.mockk) } \ No newline at end of file diff --git a/core/deep-links/src/main/kotlin/com/tangem/core/deeplink/DeeplinkConst.kt b/core/deep-links/src/main/kotlin/com/tangem/core/deeplink/DeeplinkConst.kt new file mode 100644 index 0000000000..cf598f7b4f --- /dev/null +++ b/core/deep-links/src/main/kotlin/com/tangem/core/deeplink/DeeplinkConst.kt @@ -0,0 +1,11 @@ +package com.tangem.core.deeplink + +object DeeplinkConst { + @Deprecated("Used only for push notifications mapping, use `WALLET_ID_KEY` only") + const val PAYLOAD_WALLET_ID_KEY = "user_wallet_id" + const val TANGEM_SCHEME = "tangem" + const val WALLET_ID_KEY = "walletId" + const val NETWORK_ID_KEY = "network_id" + const val TYPE_KEY = "type" + const val TOKEN_ID_KEY = "token_id" +} \ No newline at end of file diff --git a/core/deep-links/src/main/kotlin/com/tangem/core/deeplink/converter/DeepLinkBuilder.kt b/core/deep-links/src/main/kotlin/com/tangem/core/deeplink/converter/DeepLinkBuilder.kt new file mode 100644 index 0000000000..1d6216e48c --- /dev/null +++ b/core/deep-links/src/main/kotlin/com/tangem/core/deeplink/converter/DeepLinkBuilder.kt @@ -0,0 +1,64 @@ +package com.tangem.core.deeplink.converter + +import com.tangem.core.deeplink.DeeplinkConst.TANGEM_SCHEME + +/** + * Builder class for constructing deep links with a fluent interface. + */ +internal class DeepLinkBuilder { + private var scheme: String = TANGEM_SCHEME + private var action: String = "" + private val pathParams: MutableList = mutableListOf() + private val queryParams: MutableMap = mutableMapOf() + + /** + * Sets the scheme for the deep link (e.g., "tangem", "https") + */ + fun setScheme(scheme: String): DeepLinkBuilder { + this.scheme = scheme + return this + } + + /** + * Sets the action for the deep link (e.g., "link", "wallet") + */ + fun setAction(action: String): DeepLinkBuilder { + this.action = action + return this + } + + /** + * Adds a path parameter to the deep link + */ + fun addPathParam(param: String): DeepLinkBuilder { + pathParams.add(param) + return this + } + + /** + * Adds a query parameter to the deep link + */ + fun addQueryParam(key: String, value: String): DeepLinkBuilder { + queryParams[key] = value + return this + } + + /** + * Builds the deep link URI string + */ + fun build(): String { + val path = if (pathParams.isEmpty()) { + action + } else { + "$action/${pathParams.joinToString("/")}" + } + + val queryString = if (queryParams.isEmpty()) { + "" + } else { + "?" + queryParams.entries.joinToString("&") { "${it.key}=${it.value}" } + } + + return "$scheme://$path$queryString" + } +} \ No newline at end of file diff --git a/core/deep-links/src/main/kotlin/com/tangem/core/deeplink/converter/PayloadToDeeplinkConverter.kt b/core/deep-links/src/main/kotlin/com/tangem/core/deeplink/converter/PayloadToDeeplinkConverter.kt new file mode 100644 index 0000000000..8470ffbb71 --- /dev/null +++ b/core/deep-links/src/main/kotlin/com/tangem/core/deeplink/converter/PayloadToDeeplinkConverter.kt @@ -0,0 +1,45 @@ +package com.tangem.core.deeplink.converter + +import com.tangem.common.routing.DeepLinkRoute +import com.tangem.common.routing.DeepLinkScheme +import com.tangem.core.deeplink.DEEPLINK_KEY +import com.tangem.core.deeplink.DeeplinkConst.NETWORK_ID_KEY +import com.tangem.core.deeplink.DeeplinkConst.PAYLOAD_WALLET_ID_KEY +import com.tangem.core.deeplink.DeeplinkConst.TOKEN_ID_KEY +import com.tangem.core.deeplink.DeeplinkConst.TYPE_KEY +import com.tangem.core.deeplink.DeeplinkConst.WALLET_ID_KEY +import com.tangem.utils.converter.Converter + +object PayloadToDeeplinkConverter : Converter, String?> { + + override fun convert(value: Map): String? { + return when { + value[DEEPLINK_KEY] != null -> value[DEEPLINK_KEY] + isTangemPushNotificationPayload(value) -> buildNotificationDeeplink(value) + else -> null + } + } + + @Suppress("ReturnCount") + private fun buildNotificationDeeplink(payload: Map): String? { + val type = payload[TYPE_KEY] ?: return null + val networkId = payload[NETWORK_ID_KEY] ?: return null + val tokenId = payload[TOKEN_ID_KEY] ?: return null + val walletId = payload[PAYLOAD_WALLET_ID_KEY] ?: return null + + return DeepLinkBuilder().setScheme(DeepLinkScheme.Tangem.scheme) + .setAction(DeepLinkRoute.TokenDetails.host) + .addQueryParam(NETWORK_ID_KEY, networkId) + .addQueryParam(TOKEN_ID_KEY, tokenId) + .addQueryParam(TYPE_KEY, type) + .addQueryParam(WALLET_ID_KEY, walletId) + .build() + } + + private fun isTangemPushNotificationPayload(payload: Map): Boolean { + return payload.containsKey(TYPE_KEY) && + payload.containsKey(NETWORK_ID_KEY) && + payload.containsKey(TOKEN_ID_KEY) && + payload.containsKey(PAYLOAD_WALLET_ID_KEY) + } +} \ No newline at end of file diff --git a/core/deep-links/src/test/kotlin/com/tangem/core/deeplink/converter/DeepLinkBuilderTest.kt b/core/deep-links/src/test/kotlin/com/tangem/core/deeplink/converter/DeepLinkBuilderTest.kt new file mode 100644 index 0000000000..9f74bcee23 --- /dev/null +++ b/core/deep-links/src/test/kotlin/com/tangem/core/deeplink/converter/DeepLinkBuilderTest.kt @@ -0,0 +1,112 @@ +package com.tangem.core.deeplink.converter + +import com.google.common.truth.Truth.assertThat +import com.tangem.core.deeplink.DeeplinkConst +import org.junit.Before +import org.junit.Test + +internal class DeepLinkBuilderTest { + + private lateinit var deepLinkBuilder: DeepLinkBuilder + + @Before + fun setup() { + deepLinkBuilder = DeepLinkBuilder() + } + + @Test + fun `GIVEN default builder WHEN build THEN should return default scheme`() { + // WHEN + val result = deepLinkBuilder.build() + + // THEN + assertThat(result).isEqualTo("${DeeplinkConst.TANGEM_SCHEME}://") + } + + @Test + fun `GIVEN custom scheme WHEN setScheme THEN should use custom scheme`() { + // GIVEN + val customScheme = "https" + + // WHEN + val result = deepLinkBuilder + .setScheme(customScheme) + .build() + + // THEN + assertThat(result).isEqualTo("$customScheme://") + } + + @Test + fun `GIVEN action WHEN setAction THEN should include action in path`() { + // GIVEN + val action = "wallet" + + // WHEN + val result = deepLinkBuilder + .setAction(action) + .build() + + // THEN + assertThat(result).isEqualTo("${DeeplinkConst.TANGEM_SCHEME}://$action") + } + + @Test + fun `GIVEN path params WHEN addPathParam THEN should include params in path`() { + // GIVEN + val action = "wallet" + val param1 = "123" + val param2 = "456" + + // WHEN + val result = deepLinkBuilder + .setAction(action) + .addPathParam(param1) + .addPathParam(param2) + .build() + + // THEN + assertThat(result).isEqualTo("${DeeplinkConst.TANGEM_SCHEME}://$action/$param1/$param2") + } + + @Test + fun `GIVEN query params WHEN addQueryParam THEN should include params in query string`() { + // GIVEN + val action = "wallet" + val key1 = "param1" + val value1 = "value1" + val key2 = "param2" + val value2 = "value2" + + // WHEN + val result = deepLinkBuilder + .setAction(action) + .addQueryParam(key1, value1) + .addQueryParam(key2, value2) + .build() + + // THEN + assertThat(result).isEqualTo("${DeeplinkConst.TANGEM_SCHEME}://$action?$key1=$value1&$key2=$value2") + } + + @Test + fun `GIVEN complex deep link WHEN build THEN should construct correct URI`() { + // GIVEN + val scheme = "https" + val action = "wallet" + val pathParam = "123" + val queryKey = "token" + val queryValue = "abc" + + // WHEN + val result = deepLinkBuilder + .setScheme(scheme) + .setAction(action) + .addPathParam(pathParam) + .addQueryParam(queryKey, queryValue) + .build() + + // THEN + assertThat(result).isEqualTo("$scheme://$action/$pathParam?$queryKey=$queryValue") + } +} \ No newline at end of file diff --git a/core/deep-links/src/test/kotlin/com/tangem/core/deeplink/converter/PayloadToDeeplinkConverterTest.kt b/core/deep-links/src/test/kotlin/com/tangem/core/deeplink/converter/PayloadToDeeplinkConverterTest.kt new file mode 100644 index 0000000000..697ff01d29 --- /dev/null +++ b/core/deep-links/src/test/kotlin/com/tangem/core/deeplink/converter/PayloadToDeeplinkConverterTest.kt @@ -0,0 +1,123 @@ +package com.tangem.core.deeplink.converter + +import com.google.common.truth.Truth.assertThat +import com.tangem.core.deeplink.DEEPLINK_KEY +import com.tangem.core.deeplink.DeeplinkConst.NETWORK_ID_KEY +import com.tangem.core.deeplink.DeeplinkConst.PAYLOAD_WALLET_ID_KEY +import com.tangem.core.deeplink.DeeplinkConst.TOKEN_ID_KEY +import com.tangem.core.deeplink.DeeplinkConst.TYPE_KEY +import org.junit.Test + +internal class PayloadToDeeplinkConverterTest { + + @Test + fun `GIVEN payload with deeplink key WHEN convert THEN should return deeplink value`() { + // GIVEN + val payload = mapOf( + DEEPLINK_KEY to "tangem://token-details?networkId=ethereum&tokenId=0x123&type=token&walletId=wallet123", + ) + + // WHEN + val result = PayloadToDeeplinkConverter.convert(payload) + + // THEN + assertThat(result).isEqualTo( + "tangem://token-details?networkId=ethereum&tokenId=0x123&type=token&walletId=wallet123", + ) + } + + @Test + fun `GIVEN valid push notification payload with all vital values WHEN convert THEN should return correct deeplink`() { + // GIVEN + val payload = mapOf( + TYPE_KEY to "token", + NETWORK_ID_KEY to "ethereum", + TOKEN_ID_KEY to "0x123", + PAYLOAD_WALLET_ID_KEY to "wallet123", + ) + + // WHEN + val result = PayloadToDeeplinkConverter.convert(payload) + + // THEN + assertThat(result).isEqualTo( + "tangem://token?network_id=ethereum&token_id=0x123&type=token&walletId=wallet123", + ) + } + + @Test + fun `GIVEN push notification payload with missing type WHEN convert THEN should return null`() { + // GIVEN + val payload = mapOf( + NETWORK_ID_KEY to "ethereum", + TOKEN_ID_KEY to "0x123", + PAYLOAD_WALLET_ID_KEY to "wallet123", + ) + + // WHEN + val result = PayloadToDeeplinkConverter.convert(payload) + + // THEN + assertThat(result).isNull() + } + + @Test + fun `GIVEN push notification payload with missing networkId WHEN convert THEN should return null`() { + // GIVEN + val payload = mapOf( + TYPE_KEY to "token", + TOKEN_ID_KEY to "0x123", + PAYLOAD_WALLET_ID_KEY to "wallet123", + ) + + // WHEN + val result = PayloadToDeeplinkConverter.convert(payload) + + // THEN + assertThat(result).isNull() + } + + @Test + fun `GIVEN push notification payload with missing tokenId WHEN convert THEN should return null`() { + // GIVEN + val payload = mapOf( + TYPE_KEY to "token", + NETWORK_ID_KEY to "ethereum", + PAYLOAD_WALLET_ID_KEY to "wallet123", + ) + + // WHEN + val result = PayloadToDeeplinkConverter.convert(payload) + + // THEN + assertThat(result).isNull() + } + + @Test + fun `GIVEN push notification payload with missing walletId WHEN convert THEN should return null`() { + // GIVEN + val payload = mapOf( + TYPE_KEY to "token", + NETWORK_ID_KEY to "ethereum", + TOKEN_ID_KEY to "0x123", + ) + + // WHEN + val result = PayloadToDeeplinkConverter.convert(payload) + + // THEN + assertThat(result).isNull() + } + + @Test + fun `GIVEN empty payload WHEN convert THEN should return null`() { + // GIVEN + val payload = emptyMap() + + // WHEN + val result = PayloadToDeeplinkConverter.convert(payload) + + // THEN + assertThat(result).isNull() + } +} \ No newline at end of file diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/items/NetworkNameAndSymbolItem.kt b/core/ui/src/main/java/com/tangem/core/ui/components/items/ItemWithIconAndSubtext.kt similarity index 89% rename from core/ui/src/main/java/com/tangem/core/ui/components/items/NetworkNameAndSymbolItem.kt rename to core/ui/src/main/java/com/tangem/core/ui/components/items/ItemWithIconAndSubtext.kt index ac61fcce71..6a1c0b2117 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/items/NetworkNameAndSymbolItem.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/items/ItemWithIconAndSubtext.kt @@ -17,7 +17,7 @@ import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemThemePreview @Composable -fun NetworkNameAndSymbolItem(icon: Int, name: String, symbol: String, modifier: Modifier = Modifier) { +fun ItemWithIconAndSubtext(icon: Int, name: String, symbol: String, modifier: Modifier = Modifier) { Row( modifier = modifier.padding(14.dp), horizontalArrangement = Arrangement.spacedBy(4.dp), @@ -43,7 +43,7 @@ fun NetworkNameAndSymbolItem(icon: Int, name: String, symbol: String, modifier: } @Composable -fun NetworkNameAndSymbolItemShimmer(modifier: Modifier = Modifier) { +fun ItemWithIconAndSubtextShimmer(modifier: Modifier = Modifier) { Row( modifier = modifier.padding(12.dp), horizontalArrangement = Arrangement.spacedBy(4.dp), @@ -66,8 +66,8 @@ fun NetworkNameAndSymbolItemShimmer(modifier: Modifier = Modifier) { private fun ContentPreview() { TangemThemePreview { Column { - NetworkNameAndSymbolItemShimmer() - NetworkNameAndSymbolItem( + ItemWithIconAndSubtextShimmer() + ItemWithIconAndSubtext( icon = R.drawable.ic_solana_16, name = "Solana", symbol = "SOL", diff --git a/data/notifications/src/main/java/com/tangem/data/notifications/DefaultNotificationsRepository.kt b/data/notifications/src/main/java/com/tangem/data/notifications/DefaultNotificationsRepository.kt index 2adc501d9c..661b93086d 100644 --- a/data/notifications/src/main/java/com/tangem/data/notifications/DefaultNotificationsRepository.kt +++ b/data/notifications/src/main/java/com/tangem/data/notifications/DefaultNotificationsRepository.kt @@ -25,11 +25,12 @@ internal class DefaultNotificationsRepository @Inject constructor( override suspend fun createApplicationId(pushToken: String?): ApplicationId = withContext(dispatchers.io) { tangemTechApi.createApplicationId( NotificationApplicationCreateBody( - platform = appInfoProvider.platform, + platform = appInfoProvider.platform.lowercase(), device = appInfoProvider.device, systemVersion = appInfoProvider.osVersion, language = appInfoProvider.language, timezone = appInfoProvider.timezone, + version = appInfoProvider.appVersion, pushToken = pushToken, ), ).getOrThrow().appId.let(::ApplicationId) diff --git a/data/notifications/src/test/java/com/tangem/data/notifications/DefaultNotificationsRepositoryTest.kt b/data/notifications/src/test/java/com/tangem/data/notifications/DefaultNotificationsRepositoryTest.kt index f50c5c07c8..7602280459 100644 --- a/data/notifications/src/test/java/com/tangem/data/notifications/DefaultNotificationsRepositoryTest.kt +++ b/data/notifications/src/test/java/com/tangem/data/notifications/DefaultNotificationsRepositoryTest.kt @@ -50,6 +50,7 @@ class DefaultNotificationsRepositoryTest { coEvery { appInfoProvider.device } returns "test-device" coEvery { appInfoProvider.osVersion } returns "11" coEvery { appInfoProvider.language } returns "en" + coEvery { appInfoProvider.appVersion } returns "5.21.1" coEvery { appInfoProvider.timezone } returns "UTC" coEvery { tangemTechApi.createApplicationId(any()) } returns ApiResponse.Success( expectedAppIdResponse, @@ -68,6 +69,7 @@ class DefaultNotificationsRepositoryTest { systemVersion = "11", language = "en", timezone = "UTC", + version = "5.21.1", pushToken = pushToken, ), ) diff --git a/domain/notifications/models/src/main/java/com/tangem/domain/notifications/models/NotificationType.kt b/domain/notifications/models/src/main/java/com/tangem/domain/notifications/models/NotificationType.kt index ac0ce65b35..6f7ae2093a 100644 --- a/domain/notifications/models/src/main/java/com/tangem/domain/notifications/models/NotificationType.kt +++ b/domain/notifications/models/src/main/java/com/tangem/domain/notifications/models/NotificationType.kt @@ -2,6 +2,9 @@ package com.tangem.domain.notifications.models enum class NotificationType(val type: String) { Promo("promo"), + IncomeTransactions("income_transaction"), + SwapStatus("swap_status_update"), + OnrampStatus("onramp_status_update"), Unknown("unknown"), ; diff --git a/features/staking/impl/src/main/java/com/tangem/features/staking/impl/deeplink/DefaultStakingDeepLinkHandler.kt b/features/staking/impl/src/main/java/com/tangem/features/staking/impl/deeplink/DefaultStakingDeepLinkHandler.kt index 00d124d530..cc791844e8 100644 --- a/features/staking/impl/src/main/java/com/tangem/features/staking/impl/deeplink/DefaultStakingDeepLinkHandler.kt +++ b/features/staking/impl/src/main/java/com/tangem/features/staking/impl/deeplink/DefaultStakingDeepLinkHandler.kt @@ -46,7 +46,7 @@ internal class DefaultStakingDeepLinkHandler @AssistedInject constructor( Timber.e("Error on getting crypto currency list") return@launch }.firstOrNull { - it.id.rawNetworkId == networkId && it.id.rawCurrencyId?.value == tokenId + it.network.backendId == networkId && it.id.rawCurrencyId?.value == tokenId } if (cryptoCurrency == null) { diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/deeplink/DefaultTokenDetailsDeepLinkHandler.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/deeplink/DefaultTokenDetailsDeepLinkHandler.kt index 472ec871d8..4b8988a101 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/deeplink/DefaultTokenDetailsDeepLinkHandler.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/deeplink/DefaultTokenDetailsDeepLinkHandler.kt @@ -3,6 +3,10 @@ package com.tangem.feature.tokendetails.deeplink import arrow.core.getOrElse import com.tangem.common.routing.AppRoute import com.tangem.common.routing.AppRouter +import com.tangem.core.deeplink.DeeplinkConst.NETWORK_ID_KEY +import com.tangem.core.deeplink.DeeplinkConst.TOKEN_ID_KEY +import com.tangem.core.deeplink.DeeplinkConst.TYPE_KEY +import com.tangem.core.deeplink.DeeplinkConst.WALLET_ID_KEY import com.tangem.domain.notifications.models.NotificationType import com.tangem.domain.tokens.FetchCurrencyStatusUseCase import com.tangem.domain.tokens.GetCryptoCurrenciesUseCase @@ -45,13 +49,14 @@ internal class DefaultTokenDetailsDeepLinkHandler @AssistedInject constructor( val tokenId = queryParams[TOKEN_ID_KEY] val type = NotificationType.getType(queryParams[TYPE_KEY]) - if (type == NotificationType.Promo) { + if (type != NotificationType.Unknown) { scope.launch { val cryptoCurrency = getCryptoCurrenciesUseCase(userWalletId = userWalletId).getOrElse { Timber.e("Error on getting crypto currency list") return@launch }.firstOrNull { - it.id.rawNetworkId == networkId && it.id.rawCurrencyId?.value == tokenId + it.network.backendId == networkId && + it.id.rawCurrencyId?.value == tokenId } if (cryptoCurrency == null) { @@ -91,11 +96,4 @@ internal class DefaultTokenDetailsDeepLinkHandler @AssistedInject constructor( isFromOnNewIntent: Boolean, ): DefaultTokenDetailsDeepLinkHandler } - - private companion object { - const val WALLET_ID_KEY = "walletId" - const val NETWORK_ID_KEY = "network_id" - const val TYPE_KEY = "type" - const val TOKEN_ID_KEY = "token_id" - } } \ No newline at end of file diff --git a/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/component/impl/DefaultWalletSettingsComponent.kt b/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/component/impl/DefaultWalletSettingsComponent.kt index 7cce71989f..49f23d0f8c 100644 --- a/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/component/impl/DefaultWalletSettingsComponent.kt +++ b/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/component/impl/DefaultWalletSettingsComponent.kt @@ -87,8 +87,7 @@ internal class DefaultWalletSettingsComponent @AssistedInject constructor( ): ComposableBottomSheetComponent = networksAvailableForNotificationsComponent.create( context = childByContext(componentContext), params = NetworksAvailableForNotificationsComponent.Params( - onDismiss = model - .bottomSheetNavigation::dismiss, + onDismiss = model.bottomSheetNavigation::dismiss, ), ) diff --git a/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/ui/NetworksAvailableForNotificationsListBS.kt b/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/ui/NetworksAvailableForNotificationsListBS.kt index 529f6aa643..c83131ad9f 100644 --- a/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/ui/NetworksAvailableForNotificationsListBS.kt +++ b/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/ui/NetworksAvailableForNotificationsListBS.kt @@ -21,8 +21,8 @@ import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfigContent import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheetTitle import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheetWithFooter -import com.tangem.core.ui.components.items.NetworkNameAndSymbolItem -import com.tangem.core.ui.components.items.NetworkNameAndSymbolItemShimmer +import com.tangem.core.ui.components.items.ItemWithIconAndSubtext +import com.tangem.core.ui.components.items.ItemWithIconAndSubtextShimmer import com.tangem.core.ui.extensions.* import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemThemePreview @@ -136,12 +136,12 @@ private fun Networks( ) if (isLoading) { repeat(SHIMMERS_COUNT) { - NetworkNameAndSymbolItemShimmer() + ItemWithIconAndSubtextShimmer() } } else { networks.fastForEach { network -> key(network.id) { - NetworkNameAndSymbolItem( + ItemWithIconAndSubtext( icon = network.icon, name = network.name, symbol = network.symbol, diff --git a/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/ui/state/NetworksAvailableForNotificationsUM.kt b/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/ui/state/NetworksAvailableForNotificationsUM.kt index 541a2ffbea..fa89f10b1c 100644 --- a/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/ui/state/NetworksAvailableForNotificationsUM.kt +++ b/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/ui/state/NetworksAvailableForNotificationsUM.kt @@ -3,7 +3,7 @@ package com.tangem.feature.walletsettings.ui.state import com.tangem.domain.notifications.models.NotificationsEligibleNetwork import kotlinx.collections.immutable.ImmutableList -data class NetworksAvailableForNotificationsUM( +internal data class NetworksAvailableForNotificationsUM( val networks: ImmutableList, val isLoading: Boolean, ) \ No newline at end of file