Updated on 2026-08-14
This commit is contained in:
parent
33d59bf54e
commit
76894a77a7
6 changed files with 26 additions and 0 deletions
|
|
@ -95,6 +95,7 @@ internal class DefaultMarketsTokenDetailsComponent(
|
|||
tokenName = state.tokenName,
|
||||
tokenPrice = state.priceText,
|
||||
backgroundColor = background,
|
||||
onShareClick = state.onShareClick,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.tangem.core.analytics.api.AnalyticsEventHandler
|
|||
import com.tangem.core.decompose.di.ModelScoped
|
||||
import com.tangem.core.decompose.model.Model
|
||||
import com.tangem.core.decompose.model.ParamsContainer
|
||||
import com.tangem.core.navigation.share.ShareManager
|
||||
import com.tangem.core.navigation.url.UrlOpener
|
||||
import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig
|
||||
import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfigContent
|
||||
|
|
@ -83,6 +84,7 @@ internal class MarketsTokenDetailsModel @Inject constructor(
|
|||
private val excludedBlockchains: ExcludedBlockchains,
|
||||
private val urlOpener: UrlOpener,
|
||||
private val getNewsUseCase: GetNewsUseCase,
|
||||
private val shareManager: ShareManager,
|
||||
) : Model() {
|
||||
|
||||
private val quotesJob = JobHolder()
|
||||
|
|
@ -247,6 +249,7 @@ internal class MarketsTokenDetailsModel @Inject constructor(
|
|||
onFirstVisible = {},
|
||||
onScroll = {},
|
||||
),
|
||||
onShareClick = ::onShareClick,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
@ -662,6 +665,13 @@ internal class MarketsTokenDetailsModel @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun onShareClick() {
|
||||
val tokenId = params.token.id.value
|
||||
val shareUrl = "$CRYPTOCURRENCIES_BASE_URL$tokenId"
|
||||
shareManager.shareText(shareUrl)
|
||||
analyticsEventHandler.send(analyticsEventBuilder.shareClicked())
|
||||
}
|
||||
|
||||
private fun onListedOnClick(exchangesCount: Int) {
|
||||
modelScope.launch {
|
||||
analyticsEventHandler.send(analyticsEventBuilder.exchangesScreenOpened())
|
||||
|
|
@ -725,5 +735,6 @@ internal class MarketsTokenDetailsModel @Inject constructor(
|
|||
private companion object {
|
||||
const val QUOTES_UPDATE_INTERVAL_MILLIS = 60000L
|
||||
const val RELATED_NEWS_LIMIT = 10
|
||||
const val CRYPTOCURRENCIES_BASE_URL = "https://tangem.com/en/cryptocurrencies/"
|
||||
}
|
||||
}
|
||||
|
|
@ -65,6 +65,11 @@ internal class MarketDetailsAnalyticsEvent(
|
|||
"Provider" to provider,
|
||||
),
|
||||
)
|
||||
|
||||
fun shareClicked() = MarketDetailsAnalyticsEvent(
|
||||
event = "Button - Share",
|
||||
params = mapOf("Token" to token.symbol),
|
||||
)
|
||||
}
|
||||
|
||||
enum class IntervalType(val source: String) {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import com.tangem.core.ui.res.TangemThemePreview
|
|||
import com.tangem.domain.markets.PriceChangeInterval
|
||||
import com.tangem.features.feed.impl.R
|
||||
import com.tangem.features.feed.ui.market.detailed.components.*
|
||||
import com.tangem.core.ui.R as CoreR
|
||||
import com.tangem.features.feed.ui.market.detailed.preview.MarketsTokenDetailsPreview
|
||||
import com.tangem.features.feed.ui.market.detailed.state.ExchangesBottomSheetContent
|
||||
import com.tangem.features.feed.ui.market.detailed.state.InfoBottomSheetContent
|
||||
|
|
@ -150,6 +151,7 @@ internal fun MarketsTokenDetailsTopBar(
|
|||
tokenPrice: String,
|
||||
isBackButtonEnabled: Boolean,
|
||||
onBackClick: () -> Unit,
|
||||
onShareClick: () -> Unit,
|
||||
) {
|
||||
TangemTopAppBar(
|
||||
modifier = Modifier.drawBehind { drawRect(backgroundColor) },
|
||||
|
|
@ -159,6 +161,10 @@ internal fun MarketsTokenDetailsTopBar(
|
|||
onBackClicked = onBackClick,
|
||||
enabled = isBackButtonEnabled,
|
||||
),
|
||||
endButton = TopAppBarButtonUM.Icon(
|
||||
iconRes = CoreR.drawable.ic_share_24,
|
||||
onClicked = onShareClick,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ internal object MarketsTokenDetailsPreview {
|
|||
onFirstVisible = {},
|
||||
onScroll = {},
|
||||
),
|
||||
onShareClick = {},
|
||||
)
|
||||
|
||||
val contentState = MarketsTokenDetailsUM(
|
||||
|
|
@ -141,5 +142,6 @@ internal object MarketsTokenDetailsPreview {
|
|||
onFirstVisible = {},
|
||||
onScroll = {},
|
||||
),
|
||||
onShareClick = {},
|
||||
)
|
||||
}
|
||||
|
|
@ -28,6 +28,7 @@ internal data class MarketsTokenDetailsUM(
|
|||
val shouldShowPriceSubtitle: Boolean,
|
||||
val onShouldShowPriceSubtitleChange: (Boolean) -> Unit,
|
||||
val relatedNews: RelatedNews,
|
||||
val onShareClick: () -> Unit,
|
||||
) {
|
||||
|
||||
data class ChartState(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue