Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: change bottom sheet error code to string #689

Merged
merged 3 commits into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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