diff --git a/ocean-components/src/main/java/br/com/useblu/oceands/components/compose/OceanTransactionFooter.kt b/ocean-components/src/main/java/br/com/useblu/oceands/components/compose/OceanTransactionFooter.kt index da4d1b11..ebfe7529 100644 --- a/ocean-components/src/main/java/br/com/useblu/oceands/components/compose/OceanTransactionFooter.kt +++ b/ocean-components/src/main/java/br/com/useblu/oceands/components/compose/OceanTransactionFooter.kt @@ -15,73 +15,9 @@ import br.com.useblu.oceands.model.OceanInlineTextList import br.com.useblu.oceands.ui.compose.OceanButtonStyle import br.com.useblu.oceands.ui.compose.OceanColors import br.com.useblu.oceands.ui.compose.OceanSpacing +import br.com.useblu.oceands.ui.compose.OceanTextStyle import br.com.useblu.oceands.utils.OceanIcons -@Preview -@Composable -private fun OceanTransactionFooterPreview() { - val entries = listOf( - OceanInlineTextList( - label = "Label1", - value = "R$ 40,00", - newValue = "Zero", - color = "colorStatusPositiveDeep", - icon = "tagsolid" - ), - OceanInlineTextList( - label = "Label1 - teste", - value = "R$ 40,00", - newValue = "", - color = "colorStatusPositiveDeep" - ), - OceanInlineTextList( - label = "Label2", - value = "R$ 40,00", - color = "colorInterfaceDarkDown" - - ), - OceanInlineTextList( - label = "Label3", - value = "Calculada no dia", - color = "colorStatusNeutralDeep" - - ), - OceanInlineTextList( - label = "Label4", - value = "R$ 10,00", - tooltip = "tooltip", - color = "colorStatusPositiveDeep", - icon = "tagsolid" - - ), - OceanInlineTextList( - label = "Label5", - value = "R$ 40,00", - color = "colorInterfaceDarkPure", - isBold = true, - icon = OceanIcons.BRIEFCASE_OUTLINE.token - - ) - ) - - OceanTheme { - OceanTransactionFooter( - entries = entries, - firstButton = OceanButtonModel( - text = "Avançar", - onClick = {}, - buttonStyle = OceanButtonStyle.PrimaryMedium - ), - secondButton = OceanButtonModel( - text = "Voltar", - onClick = {}, - buttonStyle = OceanButtonStyle.SecondaryMedium - ), - buttonsOrientation = Orientation.Vertical - ) - } -} - @Composable fun OceanTransactionFooter( modifier: Modifier = Modifier, @@ -89,7 +25,8 @@ fun OceanTransactionFooter( firstButton: OceanButtonModel, secondButton: OceanButtonModel? = null, entriesSpacing: Dp = OceanSpacing.xxs, - buttonsOrientation: Orientation = Orientation.Vertical + buttonsOrientation: Orientation = Orientation.Vertical, + caption: String = "" ) { Column( modifier = modifier @@ -98,13 +35,19 @@ fun OceanTransactionFooter( verticalArrangement = Arrangement.spacedBy(OceanSpacing.xs) ) { Column( - verticalArrangement = Arrangement.spacedBy(entriesSpacing) + verticalArrangement = Arrangement.spacedBy(entriesSpacing), + horizontalAlignment = Alignment.CenterHorizontally ) { entries.forEach { item -> OceanInlineTextListItem( item = item ) } + OceanTextNotBlank( + text = caption, + style = OceanTextStyle.paragraph, + color = OceanColors.interfaceDarkUp + ) } val buttons: @Composable (Modifier) -> Unit = { @@ -149,3 +92,69 @@ fun OceanTransactionFooter( } } } + +@Preview +@Composable +private fun OceanTransactionFooterPreview() { + val entries = listOf( + OceanInlineTextList( + label = "Label1", + value = "R$ 40,00", + newValue = "Zero", + color = "colorStatusPositiveDeep", + icon = "tagsolid" + ), + OceanInlineTextList( + label = "Label1 - teste", + value = "R$ 40,00", + newValue = "", + color = "colorStatusPositiveDeep" + ), + OceanInlineTextList( + label = "Label2", + value = "R$ 40,00", + color = "colorInterfaceDarkDown" + + ), + OceanInlineTextList( + label = "Label3", + value = "Calculada no dia", + color = "colorStatusNeutralDeep" + + ), + OceanInlineTextList( + label = "Label4", + value = "R$ 10,00", + tooltip = "tooltip", + color = "colorStatusPositiveDeep", + icon = "tagsolid" + + ), + OceanInlineTextList( + label = "Label5", + value = "R$ 40,00", + color = "colorInterfaceDarkPure", + isBold = true, + icon = OceanIcons.BRIEFCASE_OUTLINE.token + + ) + ) + + OceanTheme { + OceanTransactionFooter( + entries = entries, + firstButton = OceanButtonModel( + text = "Avançar", + onClick = {}, + buttonStyle = OceanButtonStyle.PrimaryMedium + ), + secondButton = OceanButtonModel( + text = "Voltar", + onClick = {}, + buttonStyle = OceanButtonStyle.SecondaryMedium + ), + buttonsOrientation = Orientation.Vertical, + caption = "Lorem ipsum dolor sit amet, consectetur adipis" + ) + } +}