Updated on 2026-08-14
This commit is contained in:
parent
477a3c11dd
commit
88a80a7d3a
49 changed files with 68 additions and 70 deletions
|
|
@ -35,7 +35,7 @@ internal class MainScreenStateHolder(private val intents: MainIntents) {
|
|||
stateFlowInternal.update { state ->
|
||||
state.copy(
|
||||
modalNotification = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = intents::onDismissBottomSheet,
|
||||
content = notificationsFactory.createBalancesAreHiddenModalNotification(),
|
||||
),
|
||||
|
|
@ -45,7 +45,7 @@ internal class MainScreenStateHolder(private val intents: MainIntents) {
|
|||
|
||||
fun updateWithoutModalNotification() {
|
||||
stateFlowInternal.update { state ->
|
||||
state.copy(modalNotification = state.modalNotification?.copy(isShow = false))
|
||||
state.copy(modalNotification = state.modalNotification?.copy(isShown = false))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ internal class MainViewModel @Inject constructor(
|
|||
it.isBalanceHidingNotificationEnabled && it.isBalanceHidden
|
||||
}
|
||||
.onEach {
|
||||
if (state.value.modalNotification?.isShow != true && !it.isUpdateFromToast) {
|
||||
if (state.value.modalNotification?.isShown != true && !it.isUpdateFromToast) {
|
||||
listenToFlipsUseCase.changeUpdateEnabled(false)
|
||||
stateHolder.updateWithHiddenBalancesNotification()
|
||||
router.push(AppRoute.ModalNotification)
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ internal class ModalNotificationBottomSheetFragment : ComposeBottomSheetFragment
|
|||
}
|
||||
|
||||
LaunchedEffect(notification) {
|
||||
if (!notification.isShow) {
|
||||
if (!notification.isShown) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ private fun Preview_GiveTxPermissionBottomSheet() {
|
|||
TangemThemePreview {
|
||||
GiveTxPermissionBottomSheet(
|
||||
config = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = {},
|
||||
content = previewData,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.tangem.core.ui.components.bottomsheets
|
|||
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.activity.compose.LocalOnBackPressedDispatcherOwner
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.focusable
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material3.*
|
||||
|
|
@ -99,7 +98,7 @@ inline fun <reified T : TangemBottomSheetConfigContent> DefaultBottomSheet(
|
|||
crossinline title: @Composable (BoxScope.(T) -> Unit),
|
||||
crossinline content: @Composable (ColumnScope.(T) -> Unit),
|
||||
) {
|
||||
var isVisible by remember { mutableStateOf(value = config.isShow) }
|
||||
var isVisible by remember { mutableStateOf(value = config.isShown) }
|
||||
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = skipPartiallyExpanded)
|
||||
|
||||
if (isVisible && config.content is T) {
|
||||
|
|
@ -114,8 +113,8 @@ inline fun <reified T : TangemBottomSheetConfigContent> DefaultBottomSheet(
|
|||
)
|
||||
}
|
||||
|
||||
LaunchedEffect(key1 = config.isShow) {
|
||||
if (config.isShow) {
|
||||
LaunchedEffect(key1 = config.isShown) {
|
||||
if (config.isShown) {
|
||||
isVisible = true
|
||||
} else {
|
||||
sheetState.collapse { isVisible = false }
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@ package com.tangem.core.ui.components.bottomsheets
|
|||
/**
|
||||
* Tangem bottom sheet config
|
||||
*
|
||||
* @property isShow flag that determine if bottom sheet is shown
|
||||
* @property isShown flag that determine if bottom sheet is shown
|
||||
* @property onDismissRequest lambda be invoked when bottom sheet is dismissed
|
||||
* @property content content config
|
||||
*/
|
||||
data class TangemBottomSheetConfig(
|
||||
val isShow: Boolean,
|
||||
val isShown: Boolean,
|
||||
val onDismissRequest: () -> Unit,
|
||||
val content: TangemBottomSheetConfigContent,
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ private fun Preview_NotificationBottomSheet(
|
|||
MessageBottomSheet(
|
||||
config = TangemBottomSheetConfig(
|
||||
content = params,
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = {},
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ private fun Preview_TokenReceiveBottomSheet(
|
|||
) {
|
||||
TangemThemePreview {
|
||||
val config = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
content = params,
|
||||
onDismissRequest = {},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ fun EventMessageEffect(
|
|||
@Composable
|
||||
private fun MessageBottomSheet(message: BottomSheetMessage, onDismissRequest: () -> Unit) {
|
||||
val config = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
content = MessageBottomSheetUM(
|
||||
iconResId = message.iconResId,
|
||||
title = message.title,
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ internal class DefaultAddCustomTokenComponent @AssistedInject constructor(
|
|||
override fun BottomSheet() {
|
||||
val config = remember {
|
||||
TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = ::dismiss,
|
||||
content = initialConfiguration.step.toContentModel(::popBack),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ internal class PreviewAddCustomTokenComponent(
|
|||
override fun BottomSheet() {
|
||||
val config by previewConfig.collectAsStateWithLifecycle()
|
||||
val bottomSheetConfig = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = ::dismiss,
|
||||
content = config.step.toContentModel(::dismiss),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ internal class MarketsTokenDetailsModel @Inject constructor(
|
|||
body = MarketsTokenDetailsUM.Body.Loading,
|
||||
triggerPriceChange = consumedEvent(),
|
||||
bottomSheetConfig = TangemBottomSheetConfig(
|
||||
isShow = false,
|
||||
isShown = false,
|
||||
onDismissRequest = {},
|
||||
content = TangemBottomSheetConfigContent.Empty,
|
||||
),
|
||||
|
|
@ -510,7 +510,7 @@ internal class MarketsTokenDetailsModel @Inject constructor(
|
|||
state.update { stateToUpdate ->
|
||||
stateToUpdate.copy(
|
||||
bottomSheetConfig = stateToUpdate.bottomSheetConfig.copy(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = ::hideBottomSheet,
|
||||
content = content,
|
||||
),
|
||||
|
|
@ -521,7 +521,7 @@ internal class MarketsTokenDetailsModel @Inject constructor(
|
|||
private fun hideBottomSheet() {
|
||||
state.update { stateToUpdate ->
|
||||
stateToUpdate.copy(
|
||||
bottomSheetConfig = stateToUpdate.bottomSheetConfig.copy(isShow = false),
|
||||
bottomSheetConfig = stateToUpdate.bottomSheetConfig.copy(isShown = false),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ private fun Preview() {
|
|||
onSelectedIntervalChange = { },
|
||||
body = MarketsTokenDetailsUM.Body.Loading,
|
||||
bottomSheetConfig = TangemBottomSheetConfig(
|
||||
isShow = false,
|
||||
isShown = false,
|
||||
onDismissRequest = {},
|
||||
content = TangemBottomSheetConfigContent.Empty,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ private fun Preview_ExchangesBottomSheet(
|
|||
config = TangemBottomSheetConfig(
|
||||
onDismissRequest = {},
|
||||
content = content,
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ private fun SecurityScoreBottomSheetPreview() {
|
|||
TangemThemePreview {
|
||||
SecurityScoreBottomSheet(
|
||||
config = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = {},
|
||||
content = SecurityScorePreviewData.bottomSheetContent,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ internal class AddToPortfolioBSContentUMFactory(
|
|||
alreadyAddedNetworks: Set<String>?,
|
||||
): TangemBottomSheetConfig {
|
||||
return TangemBottomSheetConfig(
|
||||
isShow = portfolioUIData.portfolioBSVisibilityModel.addToPortfolioBSVisibility,
|
||||
isShown = portfolioUIData.portfolioBSVisibilityModel.addToPortfolioBSVisibility,
|
||||
onDismissRequest = { onAddToPortfolioVisibilityChange(false) },
|
||||
content = if (selectedWallet != null && alreadyAddedNetworks != null) {
|
||||
AddToPortfolioBSContentUM(
|
||||
|
|
@ -107,7 +107,7 @@ internal class AddToPortfolioBSContentUMFactory(
|
|||
selectedWalletId: UserWalletId,
|
||||
): TangemBottomSheetConfig {
|
||||
return TangemBottomSheetConfig(
|
||||
isShow = isShow,
|
||||
isShown = isShow,
|
||||
onDismissRequest = { onWalletSelectorVisibilityChange(false) },
|
||||
content = WalletSelectorBSContentUM(
|
||||
userWallets = portfolioData.walletsWithCurrencies
|
||||
|
|
|
|||
|
|
@ -101,10 +101,10 @@ internal class TokenActionsHandler @AssistedInject constructor(
|
|||
|
||||
updateTokenReceiveBSConfig {
|
||||
TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = {
|
||||
updateTokenReceiveBSConfig {
|
||||
it.copy(isShow = false)
|
||||
it.copy(isShown = false)
|
||||
}
|
||||
},
|
||||
content = TokenReceiveBottomSheetConfig(
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ private fun Preview(
|
|||
TangemThemePreview {
|
||||
AddToPortfolioBottomSheet(
|
||||
config = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
content = content,
|
||||
onDismissRequest = {},
|
||||
),
|
||||
|
|
@ -370,7 +370,7 @@ private fun PreviewContentTestOnDevice(
|
|||
|
||||
AddToPortfolioBottomSheet(
|
||||
config = TangemBottomSheetConfig(
|
||||
isShow = isShow,
|
||||
isShown = isShow,
|
||||
content = contentState,
|
||||
onDismissRequest = { isShow = false },
|
||||
),
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ private fun Preview() {
|
|||
Box(Modifier.background(TangemTheme.colors.background.secondary)) {
|
||||
TokenActionsBottomSheet(
|
||||
TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = {},
|
||||
content = TokenActionsBSContentUM(
|
||||
title = "Wallet 1",
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ private fun Preview() {
|
|||
TangemThemePreview {
|
||||
WalletSelectorBottomSheet(
|
||||
config = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = {},
|
||||
content = WalletSelectorBSContentUM(
|
||||
userWallets = persistentListOf(
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ internal class MarketsListUMStateManager(
|
|||
) {
|
||||
|
||||
private var sortByBottomSheetIsShown
|
||||
get() = state.value.sortByBottomSheet.isShow
|
||||
set(value) = state.update { it.copy(sortByBottomSheet = it.sortByBottomSheet.copy(isShow = value)) }
|
||||
get() = state.value.sortByBottomSheet.isShown
|
||||
set(value) = state.update { it.copy(sortByBottomSheet = it.sortByBottomSheet.copy(isShown = value)) }
|
||||
|
||||
var searchQuery
|
||||
get() = state.value.searchBar.query
|
||||
|
|
@ -203,7 +203,7 @@ internal class MarketsListUMStateManager(
|
|||
onIntervalClick = { selectedInterval = it },
|
||||
onSortByButtonClick = { sortByBottomSheetIsShown = true },
|
||||
sortByBottomSheet = TangemBottomSheetConfig(
|
||||
isShow = false,
|
||||
isShown = false,
|
||||
onDismissRequest = { sortByBottomSheetIsShown = false },
|
||||
content = SortByBottomSheetContentUM(
|
||||
selectedOption = SortByTypeUM.Rating,
|
||||
|
|
@ -217,7 +217,7 @@ internal class MarketsListUMStateManager(
|
|||
it.copy(
|
||||
selectedSortBy = sortByTypeUM,
|
||||
sortByBottomSheet = it.sortByBottomSheet.copy(
|
||||
isShow = false,
|
||||
isShown = false,
|
||||
content = (it.sortByBottomSheet.content as SortByBottomSheetContentUM).copy(
|
||||
selectedOption = sortByTypeUM,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ internal fun MarketsList(
|
|||
)
|
||||
MarketsListSortByBottomSheet(config = state.sortByBottomSheet)
|
||||
KeyboardEvents(
|
||||
isSortByBottomSheetShown = state.sortByBottomSheet.isShow,
|
||||
isSortByBottomSheetShown = state.sortByBottomSheet.isShown,
|
||||
bottomSheetState = bottomSheetState,
|
||||
)
|
||||
}
|
||||
|
|
@ -321,7 +321,7 @@ private fun Preview() {
|
|||
onIntervalClick = {},
|
||||
onSortByButtonClick = {},
|
||||
sortByBottomSheet = TangemBottomSheetConfig(
|
||||
isShow = false,
|
||||
isShown = false,
|
||||
onDismissRequest = {},
|
||||
content = SortByBottomSheetContentUM(selectedOption = SortByTypeUM.Rating) {},
|
||||
),
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ private fun Preview() {
|
|||
Box(Modifier.background(TangemTheme.colors.background.secondary)) {
|
||||
MarketsListSortByBottomSheet(
|
||||
TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = {},
|
||||
content = SortByBottomSheetContentUM(
|
||||
selectedOption = SortByTypeUM.Trending,
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class MultiWalletAccessCodeComponent(
|
|||
|
||||
val bsConfig = remember(this, showBs) {
|
||||
TangemBottomSheetConfig(
|
||||
isShow = showBs,
|
||||
isShown = showBs,
|
||||
onDismissRequest = { dismiss() },
|
||||
content = TangemBottomSheetConfigContent.Empty,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ internal class ImportSeedPhraseUiStateBuilder(
|
|||
updateUiState { state ->
|
||||
state.copy(
|
||||
infoBottomSheetConfig = TangemBottomSheetConfig.Empty.copy(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = {
|
||||
updateUiState { it.copy(infoBottomSheetConfig = TangemBottomSheetConfig.Empty) }
|
||||
},
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class ImportSeedPhraseStateBuilder {
|
|||
return uiState.copy(
|
||||
importSeedPhraseState = uiState.importSeedPhraseState.copy(
|
||||
bottomSheetConfig = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = onDismiss,
|
||||
content = ShowPassphraseInfoBottomSheetContent(onDismiss),
|
||||
),
|
||||
|
|
@ -81,7 +81,7 @@ class ImportSeedPhraseStateBuilder {
|
|||
return uiState.copy(
|
||||
importSeedPhraseState = uiState.importSeedPhraseState.copy(
|
||||
bottomSheetConfig = uiState.importSeedPhraseState.bottomSheetConfig?.copy(
|
||||
isShow = false,
|
||||
isShown = false,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ internal class DefaultConfirmResidencyComponent @AssistedInject constructor(
|
|||
val bottomSheet by bottomSheetSlot.subscribeAsState()
|
||||
val bottomSheetConfig = remember(key1 = this) {
|
||||
TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = ::dismiss,
|
||||
content = TangemBottomSheetConfigContent.Empty,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ internal class PreviewConfirmResidencyComponent(
|
|||
val state by previewState.collectAsStateWithLifecycle()
|
||||
val bottomSheetConfig = remember(key1 = this) {
|
||||
TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = ::dismiss,
|
||||
content = TangemBottomSheetConfigContent.Empty,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ internal class DefaultSelectPaymentMethodComponent @AssistedInject constructor(
|
|||
override fun BottomSheet() {
|
||||
val bottomSheetConfig = remember(key1 = this) {
|
||||
TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = ::dismiss,
|
||||
content = PaymentMethodsBottomSheetConfig(
|
||||
selectedMethodId = params.selectedMethodId,
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ internal class DefaultSelectProviderComponent @AssistedInject constructor(
|
|||
|
||||
val bottomSheetConfig = remember(key1 = this) {
|
||||
TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = ::dismiss,
|
||||
content = TangemBottomSheetConfigContent.Empty,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ internal class DefaultSelectCountryComponent @AssistedInject constructor(
|
|||
val state by model.state.collectAsStateWithLifecycle()
|
||||
val bottomSheetConfig = remember(key1 = this) {
|
||||
TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = ::dismiss,
|
||||
content = TangemBottomSheetConfigContent.Empty,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ internal class DefaultSelectCurrencyComponent @AssistedInject constructor(
|
|||
val state by model.state.collectAsStateWithLifecycle()
|
||||
val bottomSheetConfig = remember(key1 = this) {
|
||||
TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = ::dismiss,
|
||||
content = TangemBottomSheetConfigContent.Empty,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ private fun Preview_CameraDeniedBottomSheet() {
|
|||
TangemThemePreview {
|
||||
CameraDeniedBottomSheet(
|
||||
config = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = {},
|
||||
content = CameraDeniedBottomSheetConfig(
|
||||
onSettingsClick = {},
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ internal class ShowCameraDeniedBottomSheetTransformer(
|
|||
override fun transform(prevState: QrScanningState): QrScanningState {
|
||||
return prevState.copy(
|
||||
bottomSheetConfig = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = clickIntents::onBackClick,
|
||||
content = CameraDeniedBottomSheetConfig(
|
||||
onSettingsClick = clickIntents::onSettingsClick,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ internal class ShowActionSelectorBottomSheetTransformer(
|
|||
override fun transform(prevState: StakingUiState): StakingUiState {
|
||||
return prevState.copy(
|
||||
bottomSheetConfig = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
content = StakingActionSelectionBottomSheetConfig(
|
||||
title = resourceReference(R.string.common_choose_action),
|
||||
actions = pendingActions,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ internal class ShowInfoBottomSheetStateTransformer(
|
|||
return prevState.copy(
|
||||
bottomSheetConfig = TangemBottomSheetConfig(
|
||||
onDismissRequest = onDismiss,
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
content = when (infoType) {
|
||||
InfoType.ANNUAL_PERCENTAGE_RATE -> StakingInfoBottomSheetConfig(
|
||||
title = resourceReference(R.string.staking_details_annual_percentage_rate),
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ internal class SetApprovalBottomSheetInProgressTransformer(
|
|||
return prevState.copy(
|
||||
bottomSheetConfig = prevState.bottomSheetConfig?.copy(
|
||||
onDismissRequest = onDismiss,
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
content = approvalBottomSheetConfig?.let { config ->
|
||||
config.copy(
|
||||
data = config.data.copy(
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ internal class ShowApprovalBottomSheetTransformer(
|
|||
)
|
||||
return prevState.copy(
|
||||
bottomSheetConfig = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = onDismiss,
|
||||
content = GiveTxPermissionBottomSheetConfig(
|
||||
data = GiveTxPermissionState.ReadyForRequest(
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ private fun Preview_StakingActionSelectorBottomSheet() {
|
|||
TangemThemePreview {
|
||||
StakingActionSelectorBottomSheet(
|
||||
config = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = {},
|
||||
content = StakingActionSelectionBottomSheetConfig(
|
||||
title = resourceReference(R.string.common_select_action),
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ private fun Preview_StakingInfoBottomSheet() {
|
|||
TangemThemePreview {
|
||||
StakingInfoBottomSheet(
|
||||
config = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = {},
|
||||
content = StakingInfoBottomSheetConfig(
|
||||
title = stringReference("Title"),
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ private fun Preview_ChooseFeeBottomSheet() {
|
|||
TangemThemePreview {
|
||||
ChooseFeeBottomSheet(
|
||||
config = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = {},
|
||||
content = content,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ private fun Preview_ChooseProviderBottomSheet() {
|
|||
TangemThemePreview {
|
||||
ChooseProviderBottomSheet(
|
||||
TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = {},
|
||||
content = content,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import com.tangem.core.ui.components.currency.icon.converter.CryptoCurrencyToIco
|
|||
import com.tangem.core.ui.event.consumedEvent
|
||||
import com.tangem.core.ui.event.triggeredEvent
|
||||
import com.tangem.core.ui.extensions.*
|
||||
import com.tangem.core.ui.format.bigdecimal.*
|
||||
import com.tangem.core.ui.format.bigdecimal.anyDecimals
|
||||
import com.tangem.core.ui.format.bigdecimal.crypto
|
||||
import com.tangem.core.ui.format.bigdecimal.format
|
||||
|
|
@ -946,7 +945,7 @@ internal class StateBuilder(
|
|||
)
|
||||
return uiState.copy(
|
||||
bottomSheetConfig = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = onDismiss,
|
||||
content = config,
|
||||
),
|
||||
|
|
@ -957,7 +956,7 @@ internal class StateBuilder(
|
|||
|
||||
fun dismissBottomSheet(uiState: SwapStateHolder): SwapStateHolder {
|
||||
return uiState.copy(
|
||||
bottomSheetConfig = uiState.bottomSheetConfig?.copy(isShow = false),
|
||||
bottomSheetConfig = uiState.bottomSheetConfig?.copy(isShown = false),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -981,7 +980,7 @@ internal class StateBuilder(
|
|||
)
|
||||
return uiState.copy(
|
||||
bottomSheetConfig = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = onDismiss,
|
||||
content = config,
|
||||
),
|
||||
|
|
@ -1044,7 +1043,7 @@ internal class StateBuilder(
|
|||
)
|
||||
return uiState.copy(
|
||||
bottomSheetConfig = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = onDismiss,
|
||||
content = config,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1024,7 +1024,7 @@ internal class SwapViewModel @Inject constructor(
|
|||
},
|
||||
onBackClicked = {
|
||||
val bottomSheet = uiState.bottomSheetConfig
|
||||
if (bottomSheet != null && bottomSheet.isShow) {
|
||||
if (bottomSheet != null && bottomSheet.isShown) {
|
||||
uiState = stateBuilder.dismissBottomSheet(uiState)
|
||||
} else {
|
||||
if (swapRouter.currentScreen == SwapNavScreen.SelectToken) {
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ internal class TokenDetailsStateFactory(
|
|||
): TokenDetailsState {
|
||||
return currentStateProvider().copy(
|
||||
bottomSheetConfig = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = clickIntents::onDismissBottomSheet,
|
||||
content = TokenReceiveBottomSheetConfig(
|
||||
name = currency.name,
|
||||
|
|
@ -275,7 +275,7 @@ internal class TokenDetailsStateFactory(
|
|||
): TokenDetailsState {
|
||||
return currentStateProvider().copy(
|
||||
bottomSheetConfig = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = clickIntents::onDismissBottomSheet,
|
||||
content = ChooseAddressBottomSheetConfig(
|
||||
addressModels = networkAddress.availableAddresses.mapToAddressModels(currency).toImmutableList(),
|
||||
|
|
@ -288,7 +288,7 @@ internal class TokenDetailsStateFactory(
|
|||
fun getStateWithClosedBottomSheet(): TokenDetailsState {
|
||||
val state = currentStateProvider()
|
||||
return state.copy(
|
||||
bottomSheetConfig = state.bottomSheetConfig?.copy(isShow = false),
|
||||
bottomSheetConfig = state.bottomSheetConfig?.copy(isShown = false),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ internal class ExpressStatusFactory @AssistedInject constructor(
|
|||
|
||||
return currentStateProvider().copy(
|
||||
bottomSheetConfig = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = clickIntents::onDismissBottomSheet,
|
||||
content = ExpressStatusBottomSheetConfig(
|
||||
value = expressState,
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ internal object WalletPreviewData {
|
|||
|
||||
val bottomSheet by lazy {
|
||||
TangemBottomSheetConfig(
|
||||
isShow = false,
|
||||
isShown = false,
|
||||
onDismissRequest = {},
|
||||
content = WalletBottomSheetConfig.UnlockWallets(
|
||||
onUnlockClick = {},
|
||||
|
|
|
|||
|
|
@ -29,6 +29,6 @@ internal class CloseBottomSheetTransformer(userWalletId: UserWalletId) : WalletS
|
|||
}
|
||||
|
||||
private fun updateConfig(prevState: WalletState) = prevState.bottomSheetConfig?.copy(
|
||||
isShow = false,
|
||||
isShown = false,
|
||||
)
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ internal class OpenBottomSheetTransformer(
|
|||
}
|
||||
|
||||
private fun updateConfig() = TangemBottomSheetConfig(
|
||||
isShow = true,
|
||||
isShown = true,
|
||||
onDismissRequest = onDismissBottomSheet,
|
||||
content = content,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue