Skip to content

Commit 370eee1

Browse files
authored
Feat: OceanTransactionFooter with Caption (#1058)
1 parent a3c59a1 commit 370eee1

1 file changed

Lines changed: 76 additions & 67 deletions

File tree

‎ocean-components/src/main/java/br/com/useblu/oceands/components/compose/OceanTransactionFooter.kt‎

Lines changed: 76 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -15,81 +15,18 @@ import br.com.useblu.oceands.model.OceanInlineTextList
1515
import br.com.useblu.oceands.ui.compose.OceanButtonStyle
1616
import br.com.useblu.oceands.ui.compose.OceanColors
1717
import br.com.useblu.oceands.ui.compose.OceanSpacing
18+
import br.com.useblu.oceands.ui.compose.OceanTextStyle
1819
import br.com.useblu.oceands.utils.OceanIcons
1920

20-
@Preview
21-
@Composable
22-
private fun OceanTransactionFooterPreview() {
23-
val entries = listOf(
24-
OceanInlineTextList(
25-
label = "Label1",
26-
value = "R$ 40,00",
27-
newValue = "Zero",
28-
color = "colorStatusPositiveDeep",
29-
icon = "tagsolid"
30-
),
31-
OceanInlineTextList(
32-
label = "Label1 - teste",
33-
value = "R$ 40,00",
34-
newValue = "",
35-
color = "colorStatusPositiveDeep"
36-
),
37-
OceanInlineTextList(
38-
label = "Label2",
39-
value = "R$ 40,00",
40-
color = "colorInterfaceDarkDown"
41-
42-
),
43-
OceanInlineTextList(
44-
label = "Label3",
45-
value = "Calculada no dia",
46-
color = "colorStatusNeutralDeep"
47-
48-
),
49-
OceanInlineTextList(
50-
label = "Label4",
51-
value = "R$ 10,00",
52-
tooltip = "tooltip",
53-
color = "colorStatusPositiveDeep",
54-
icon = "tagsolid"
55-
56-
),
57-
OceanInlineTextList(
58-
label = "Label5",
59-
value = "R$ 40,00",
60-
color = "colorInterfaceDarkPure",
61-
isBold = true,
62-
icon = OceanIcons.BRIEFCASE_OUTLINE.token
63-
64-
)
65-
)
66-
67-
OceanTheme {
68-
OceanTransactionFooter(
69-
entries = entries,
70-
firstButton = OceanButtonModel(
71-
text = "Avançar",
72-
onClick = {},
73-
buttonStyle = OceanButtonStyle.PrimaryMedium
74-
),
75-
secondButton = OceanButtonModel(
76-
text = "Voltar",
77-
onClick = {},
78-
buttonStyle = OceanButtonStyle.SecondaryMedium
79-
),
80-
buttonsOrientation = Orientation.Vertical
81-
)
82-
}
83-
}
84-
8521
@Composable
8622
fun OceanTransactionFooter(
8723
modifier: Modifier = Modifier,
8824
entries: List<OceanInlineTextList>,
8925
firstButton: OceanButtonModel,
9026
secondButton: OceanButtonModel? = null,
9127
entriesSpacing: Dp = OceanSpacing.xxs,
92-
buttonsOrientation: Orientation = Orientation.Vertical
28+
buttonsOrientation: Orientation = Orientation.Vertical,
29+
caption: String = ""
9330
) {
9431
Column(
9532
modifier = modifier
@@ -98,13 +35,19 @@ fun OceanTransactionFooter(
9835
verticalArrangement = Arrangement.spacedBy(OceanSpacing.xs)
9936
) {
10037
Column(
101-
verticalArrangement = Arrangement.spacedBy(entriesSpacing)
38+
verticalArrangement = Arrangement.spacedBy(entriesSpacing),
39+
horizontalAlignment = Alignment.CenterHorizontally
10240
) {
10341
entries.forEach { item ->
10442
OceanInlineTextListItem(
10543
item = item
10644
)
10745
}
46+
OceanTextNotBlank(
47+
text = caption,
48+
style = OceanTextStyle.paragraph,
49+
color = OceanColors.interfaceDarkUp
50+
)
10851
}
10952

11053
val buttons: @Composable (Modifier) -> Unit = {
@@ -149,3 +92,69 @@ fun OceanTransactionFooter(
14992
}
15093
}
15194
}
95+
96+
@Preview
97+
@Composable
98+
private fun OceanTransactionFooterPreview() {
99+
val entries = listOf(
100+
OceanInlineTextList(
101+
label = "Label1",
102+
value = "R$ 40,00",
103+
newValue = "Zero",
104+
color = "colorStatusPositiveDeep",
105+
icon = "tagsolid"
106+
),
107+
OceanInlineTextList(
108+
label = "Label1 - teste",
109+
value = "R$ 40,00",
110+
newValue = "",
111+
color = "colorStatusPositiveDeep"
112+
),
113+
OceanInlineTextList(
114+
label = "Label2",
115+
value = "R$ 40,00",
116+
color = "colorInterfaceDarkDown"
117+
118+
),
119+
OceanInlineTextList(
120+
label = "Label3",
121+
value = "Calculada no dia",
122+
color = "colorStatusNeutralDeep"
123+
124+
),
125+
OceanInlineTextList(
126+
label = "Label4",
127+
value = "R$ 10,00",
128+
tooltip = "tooltip",
129+
color = "colorStatusPositiveDeep",
130+
icon = "tagsolid"
131+
132+
),
133+
OceanInlineTextList(
134+
label = "Label5",
135+
value = "R$ 40,00",
136+
color = "colorInterfaceDarkPure",
137+
isBold = true,
138+
icon = OceanIcons.BRIEFCASE_OUTLINE.token
139+
140+
)
141+
)
142+
143+
OceanTheme {
144+
OceanTransactionFooter(
145+
entries = entries,
146+
firstButton = OceanButtonModel(
147+
text = "Avançar",
148+
onClick = {},
149+
buttonStyle = OceanButtonStyle.PrimaryMedium
150+
),
151+
secondButton = OceanButtonModel(
152+
text = "Voltar",
153+
onClick = {},
154+
buttonStyle = OceanButtonStyle.SecondaryMedium
155+
),
156+
buttonsOrientation = Orientation.Vertical,
157+
caption = "Lorem ipsum dolor sit amet, consectetur adipis"
158+
)
159+
}
160+
}

0 commit comments

Comments
 (0)