@@ -7,6 +7,7 @@ import FinancialConnectionsGenericInfoScreen.Footer
7
7
import FinancialConnectionsGenericInfoScreen.Header
8
8
import Size
9
9
import android.util.Log
10
+ import androidx.compose.foundation.background
10
11
import androidx.compose.foundation.layout.Arrangement
11
12
import androidx.compose.foundation.layout.Box
12
13
import androidx.compose.foundation.layout.Column
@@ -22,17 +23,21 @@ import androidx.compose.material.Text
22
23
import androidx.compose.runtime.Composable
23
24
import androidx.compose.runtime.remember
24
25
import androidx.compose.ui.Modifier
26
+ import androidx.compose.ui.draw.clip
27
+ import androidx.compose.ui.draw.shadow
25
28
import androidx.compose.ui.text.style.TextAlign
26
29
import androidx.compose.ui.tooling.preview.Preview
27
30
import androidx.compose.ui.tooling.preview.PreviewParameter
28
31
import androidx.compose.ui.unit.dp
29
32
import com.stripe.android.financialconnections.features.common.IconSize
33
+ import com.stripe.android.financialconnections.features.common.ListItem
30
34
import com.stripe.android.financialconnections.features.common.ShapedIcon
31
35
import com.stripe.android.financialconnections.ui.FinancialConnectionsPreview
32
36
import com.stripe.android.financialconnections.ui.LocalImageLoader
33
37
import com.stripe.android.financialconnections.ui.TextResource
34
38
import com.stripe.android.financialconnections.ui.components.AnnotatedText
35
39
import com.stripe.android.financialconnections.ui.components.FinancialConnectionsButton
40
+ import com.stripe.android.financialconnections.ui.sdui.BulletUI
36
41
import com.stripe.android.financialconnections.ui.sdui.fromHtml
37
42
import com.stripe.android.financialconnections.ui.theme.FinancialConnectionsTheme.colors
38
43
import com.stripe.android.financialconnections.ui.theme.FinancialConnectionsTheme.typography
@@ -133,6 +138,23 @@ internal fun GenericBody(
133
138
modifier = Modifier .padding(horizontal = 24 .dp),
134
139
)
135
140
}
141
+ is Body .Entry .Bullets -> {
142
+ val bullets = remember(entry.bullets) {
143
+ entry.bullets.map(BulletUI ::from)
144
+ }
145
+
146
+ Column (
147
+ modifier = Modifier .padding(horizontal = 24 .dp),
148
+ ) {
149
+ bullets.forEach { bullet ->
150
+ ListItem (
151
+ bullet = bullet,
152
+ onClickableTextClick = onClickableTextClick
153
+ )
154
+ Spacer (modifier = Modifier .size(24 .dp))
155
+ }
156
+ }
157
+ }
136
158
else -> {
137
159
Log .e(" GenericBody" , " Unsupported entry type: $entry " )
138
160
}
@@ -148,16 +170,29 @@ internal fun GenericHeader(
148
170
onClickableTextClick : (String ) -> Unit ,
149
171
modifier : Modifier = Modifier ,
150
172
) {
151
- val isBrandIcon: Boolean =
152
- remember(payload.icon?.default) { payload.icon?.default?.contains(" BrandIcon" ) == true }
173
+ val isBrandIcon: Boolean = remember(payload.icon?.default) {
174
+ payload.icon?.default?.contains(" BrandIcon" ) == true
175
+ }
176
+
153
177
Column (
154
178
modifier = modifier.fillMaxWidth(),
155
179
verticalArrangement = Arrangement .spacedBy(20 .dp),
156
180
) {
181
+ val iconShape = if (isBrandIcon) RoundedCornerShape (12 .dp) else CircleShape
182
+
183
+ val iconModifier = if (isBrandIcon) {
184
+ Modifier
185
+ .shadow(8 .dp, iconShape)
186
+ .clip(iconShape)
187
+ .background(color = colors.backgroundSecondary, shape = iconShape)
188
+ } else {
189
+ Modifier
190
+ }
191
+
157
192
payload.icon?.default?.let { iconUrl ->
158
193
ShapedIcon (
159
- modifier = Modifier .align(payload.alignment.toComposeAlignment()),
160
- backgroundShape = if (isBrandIcon) RoundedCornerShape ( 12 .dp) else CircleShape ,
194
+ modifier = iconModifier .align(payload.alignment.toComposeAlignment()),
195
+ backgroundShape = iconShape ,
161
196
flushed = isBrandIcon,
162
197
url = iconUrl,
163
198
contentDescription = null ,
@@ -210,7 +245,7 @@ internal fun GenericFooter(
210
245
onClickableTextClick = onClickableTextClick,
211
246
defaultStyle = typography.labelSmall.copy(
212
247
color = colors.textDefault,
213
- textAlign = TextAlign .Start ,
248
+ textAlign = TextAlign .Center ,
214
249
),
215
250
)
216
251
}
@@ -234,11 +269,11 @@ internal fun GenericFooter(
234
269
payload.belowCta?.let { belowCta ->
235
270
AnnotatedText (
236
271
modifier = Modifier .fillMaxWidth(),
237
- text = TextResource .Text (fromHtml(belowCta.label )),
272
+ text = TextResource .Text (fromHtml(belowCta)),
238
273
onClickableTextClick = onClickableTextClick,
239
274
defaultStyle = typography.labelSmall.copy(
240
275
color = colors.textDefault,
241
- textAlign = TextAlign .Start ,
276
+ textAlign = TextAlign .Center ,
242
277
),
243
278
)
244
279
}
0 commit comments