Skip to content

Commit

Permalink
add documentation and test tag
Browse files Browse the repository at this point in the history
  • Loading branch information
xavimolloy committed Sep 14, 2023
1 parent 87f52cc commit 4e1a21f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ actual fun BottomSheetShell(
searchBar: @Composable (() -> Unit)?,
buttonBlock: @Composable (() -> Unit)?,
content: @Composable (() -> Unit)?,
modifier: Modifier,
onDismiss: () -> Unit,
) {
val sheetState = rememberModalBottomSheetState(true)
val scope = rememberCoroutineScope()

ModalBottomSheet(
modifier = modifier,
containerColor = Color.Transparent,
onDismissRequest = {
onDismiss()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ fun BottomSheetHeader(
}
}

/**
* DHIS2 BottomSheetShell. Wraps compose · [ModalBottomSheet].
* desktop version to be implemented
* @param title: title to be shown
* @param subtitle: subTitle to be shown
* @param description: PopUp description
* @param icon: the icon to be shown
* @param searchBar: dhis searchBar
* @param buttonBlock: Space for the lower buttons
* @param content: to be shown under the header
* @param onDismiss: gives access to the onDismiss event
* @param modifier allows a modifier to be passed externally
*/
@Composable
expect fun BottomSheetShell(
title: String,
Expand All @@ -66,5 +79,6 @@ expect fun BottomSheetShell(
searchBar: @Composable (() -> Unit)? = null,
buttonBlock: @Composable (() -> Unit)? = null,
content: @Composable (() -> Unit)? = null,
modifier: Modifier = Modifier,
onDismiss: () -> Unit,
)
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.testTag
import org.hisp.dhis.mobile.ui.designsystem.theme.Border
import org.hisp.dhis.mobile.ui.designsystem.theme.InternalSizeValues
import org.hisp.dhis.mobile.ui.designsystem.theme.Ripple
Expand Down Expand Up @@ -93,6 +94,7 @@ fun Legend(

if (showBottomSheetShell) {
BottomSheetShell(
modifier = Modifier.testTag("LEGEND_BOTTOM_SHEET"),
title = legendData.title,
icon = {
Icon(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ actual fun BottomSheetShell(
searchBar: @Composable (() -> Unit)?,
buttonBlock: @Composable (() -> Unit)?,
content: @Composable (() -> Unit)?,
modifier: Modifier,
onDismiss: () -> Unit,
) {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
Expand Down

0 comments on commit 4e1a21f

Please sign in to comment.