Updated on 2026-08-14
This commit is contained in:
parent
477a3c11dd
commit
88a80a7d3a
49 changed files with 68 additions and 70 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue