Skip to content
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 @@ -15,81 +15,18 @@ 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,
entries: List<OceanInlineTextList>,
firstButton: OceanButtonModel,
secondButton: OceanButtonModel? = null,
entriesSpacing: Dp = OceanSpacing.xxs,
buttonsOrientation: Orientation = Orientation.Vertical
buttonsOrientation: Orientation = Orientation.Vertical,
caption: String = ""
) {
Column(
modifier = modifier
Expand All @@ -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 = {
Expand Down Expand Up @@ -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"
)
}
}