Skip to content

Commit

Permalink
feat: change bottom sheet error code to string (#689)
Browse files Browse the repository at this point in the history
* feat: change bottom sheet error code to string

* fix build

* refactor
  • Loading branch information
fernandozblu authored Aug 2, 2024
1 parent 1c91484 commit 9157ad0
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ private fun OceanBottomSheetPreview() {
customContent = {
Text(text = "Teste de bottom sheet")
},
description = "Código: ABC123",
imageUrl = "https://portal-cicloentrada.blu.com.br/assets/icons/coin_trail-cc541831a7fbf4d215f3910fb241b14701f5ab0f79d574ad3a6e12379b7e871e.png",
title = "Bottomsheet com Imagem",
onDismiss = {
Expand Down Expand Up @@ -181,6 +182,7 @@ data class OceanBottomSheetModel(
val message: String? = null,
val subMessage: String? = null,
val code: Int? = null,
val description: String? = null,
@DrawableRes val icon: Int? = null,
val imageUrl: String? = null,
val maxWidth: Int? = null,
Expand All @@ -190,14 +192,14 @@ data class OceanBottomSheetModel(
val buttonsOrientation: BottomSheetButtonsOrientation = BottomSheetButtonsOrientation.Horizontal,
val onDismiss: () -> Unit
) {
companion object

class Button(
data class Button(
val text: String,
val icon: OceanIcons? = null,
val onClick: () -> Unit,
val isDisabled: Boolean = false
)

companion object
}


Expand Down Expand Up @@ -244,7 +246,7 @@ fun OceanBottomSheet(
sheetState = sheetState,
onDismissRequest = { model.onDismiss() },
dragHandle = null,
properties = ModalBottomSheetDefaults.properties(shouldDismissOnBackPress = model.isDismissible)
properties = ModalBottomSheetDefaults.properties(shouldDismissOnBackPress = model.isDismissible)
) {
Row(
modifier = Modifier
Expand Down Expand Up @@ -352,10 +354,12 @@ fun OceanBottomSheet(
}
)

if (model.code != null) {
if (model.code != null || model.description != null) {
val description = model.description ?: "Código: ${model.code}"

OceanSpacing.StackXS()
Text(
text = "Código: ${model.code}",
OceanText(
text = description,
style = OceanTextStyle.description,
color = OceanColors.interfaceDarkUp
)
Expand Down

0 comments on commit 9157ad0

Please sign in to comment.