Updated on 2026-08-14
This commit is contained in:
parent
2baf713fef
commit
54ab95bb11
4 changed files with 12 additions and 7 deletions
|
|
@ -2,8 +2,6 @@ package com.tangem.features.walletconnect.connections.entity
|
|||
|
||||
import com.tangem.core.ui.components.appbar.models.TopAppBarButtonUM
|
||||
import com.tangem.core.ui.components.dropdownmenu.TangemDropdownMenuItem
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
|
||||
internal data class WcConnectionsState(
|
||||
|
|
@ -27,6 +25,6 @@ internal data class WcConnectedAppInfo(
|
|||
val name: String,
|
||||
val iconUrl: String,
|
||||
val verifiedState: VerifiedDAppState,
|
||||
val subtitle: TextReference = stringReference("Connected App"),
|
||||
val subtitle: String,
|
||||
val onClick: () -> Unit,
|
||||
)
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
package com.tangem.features.walletconnect.connections.model.transformers
|
||||
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.domain.walletconnect.model.WcSession
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.features.walletconnect.connections.entity.WcConnectedAppInfo
|
||||
|
|
@ -25,7 +24,7 @@ internal class WcSessionsTransformer(
|
|||
WcConnectedAppInfo(
|
||||
name = appMetaData.name,
|
||||
iconUrl = appMetaData.icons.firstOrNull().orEmpty(),
|
||||
subtitle = stringReference(appMetaData.url),
|
||||
subtitle = WcAppSubtitleConverter.convert(session.sdkModel.appMetaData),
|
||||
verifiedState = WcDAppVerifiedStateConverter {}
|
||||
.convert(session.securityStatus to appMetaData.name),
|
||||
onClick = { openAppInfoModal(session) },
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import com.tangem.core.ui.components.PrimaryButton
|
|||
import com.tangem.core.ui.components.dropdownmenu.TangemDropdownItem
|
||||
import com.tangem.core.ui.components.dropdownmenu.TangemDropdownMenu
|
||||
import com.tangem.core.ui.components.snackbar.TangemSnackbarHost
|
||||
import com.tangem.core.ui.extensions.resolveReference
|
||||
import com.tangem.core.ui.extensions.stringResourceSafe
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
|
|
@ -227,7 +226,7 @@ private fun AppInfoItem(appInfo: WcConnectedAppInfo, modifier: Modifier = Modifi
|
|||
}
|
||||
}
|
||||
Text(
|
||||
text = appInfo.subtitle.resolveReference(),
|
||||
text = appInfo.subtitle,
|
||||
color = TangemTheme.colors.text.tertiary,
|
||||
style = TangemTheme.typography.caption2,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -23,12 +23,14 @@ internal object WcConnectionsPreviewData {
|
|||
WcConnectedAppInfo(
|
||||
name = "Moralis",
|
||||
iconUrl = "$BASE_URL/satoshi.png",
|
||||
subtitle = "https://react-app.walletconnect.com/",
|
||||
verifiedState = VerifiedDAppState.Verified {},
|
||||
onClick = { Timber.d("Moralis clicked") },
|
||||
),
|
||||
WcConnectedAppInfo(
|
||||
name = "website.com",
|
||||
iconUrl = "$BASE_URL/doge_again_lol.jpg",
|
||||
subtitle = "https://react-app.walletconnect.com/",
|
||||
onClick = { Timber.d("website.com clicked") },
|
||||
verifiedState = VerifiedDAppState.Unknown,
|
||||
),
|
||||
|
|
@ -41,6 +43,7 @@ internal object WcConnectionsPreviewData {
|
|||
WcConnectedAppInfo(
|
||||
name = "React app",
|
||||
iconUrl = "$BASE_URL/LiteCoin.png",
|
||||
subtitle = "https://react-app.walletconnect.com/",
|
||||
verifiedState = VerifiedDAppState.Verified {},
|
||||
onClick = { Timber.d("React app clicked") },
|
||||
),
|
||||
|
|
@ -53,12 +56,14 @@ internal object WcConnectionsPreviewData {
|
|||
WcConnectedAppInfo(
|
||||
name = "Moralis",
|
||||
iconUrl = "$BASE_URL/satoshi.png",
|
||||
subtitle = "https://react-app.walletconnect.com/",
|
||||
verifiedState = VerifiedDAppState.Verified {},
|
||||
onClick = { Timber.d("Moralis clicked") },
|
||||
),
|
||||
WcConnectedAppInfo(
|
||||
name = "website.com",
|
||||
iconUrl = "$BASE_URL/doge_again_lol.jpg",
|
||||
subtitle = "https://react-app.walletconnect.com/",
|
||||
verifiedState = VerifiedDAppState.Unknown,
|
||||
onClick = { Timber.d("website.com clicked") },
|
||||
),
|
||||
|
|
@ -71,6 +76,7 @@ internal object WcConnectionsPreviewData {
|
|||
WcConnectedAppInfo(
|
||||
name = "React app",
|
||||
iconUrl = "$BASE_URL/LiteCoin.png",
|
||||
subtitle = "https://react-app.walletconnect.com/",
|
||||
onClick = { Timber.d("React app clicked") },
|
||||
verifiedState = VerifiedDAppState.Verified {},
|
||||
),
|
||||
|
|
@ -83,12 +89,14 @@ internal object WcConnectionsPreviewData {
|
|||
WcConnectedAppInfo(
|
||||
name = "Moralis",
|
||||
iconUrl = "$BASE_URL/satoshi.png",
|
||||
subtitle = "https://react-app.walletconnect.com/",
|
||||
verifiedState = VerifiedDAppState.Verified {},
|
||||
onClick = { Timber.d("Moralis clicked") },
|
||||
),
|
||||
WcConnectedAppInfo(
|
||||
name = "website.com",
|
||||
iconUrl = "$BASE_URL/doge_again_lol.jpg",
|
||||
subtitle = "https://react-app.walletconnect.com/",
|
||||
onClick = { Timber.d("website.com clicked") },
|
||||
verifiedState = VerifiedDAppState.Unknown,
|
||||
),
|
||||
|
|
@ -101,6 +109,7 @@ internal object WcConnectionsPreviewData {
|
|||
WcConnectedAppInfo(
|
||||
name = "React app",
|
||||
iconUrl = "$BASE_URL/LiteCoin.png",
|
||||
subtitle = "https://react-app.walletconnect.com/",
|
||||
verifiedState = VerifiedDAppState.Verified {},
|
||||
onClick = { Timber.d("React app clicked") },
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue