Skip to content

Commit 7521080

Browse files
authored
feat: Add enable parameter to bucket and appbar components
Merge pull request #408 from Spendesk/task/disable_components
2 parents 69db6b7 + cb4750a commit 7521080

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

library-compose/src/main/java/com/spendesk/grapes/compose/appbar/GrapesTopAppBarIcons.kt

+2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ fun GrapesTopAppBarIconButton(
2020
icon: @Composable () -> Unit,
2121
modifier: Modifier = Modifier,
2222
onClick: () -> Unit = {},
23+
enabled: Boolean = true,
2324
) {
2425
IconButton(
2526
modifier = modifier,
2627
content = icon,
2728
onClick = onClick,
29+
enabled = enabled,
2830
)
2931
}
3032

library-compose/src/main/java/com/spendesk/grapes/compose/bucket/GrapesBucketHeadline.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ fun GrapesBucketHeadline(
2929
modifier: Modifier = Modifier,
3030
action: String? = null,
3131
actionColor: Color? = null,
32+
actionEnabled: Boolean = true,
3233
onActionClicked: (() -> Unit)? = null
3334
) {
3435
Row(modifier = modifier.fillMaxWidth()) {
@@ -43,7 +44,7 @@ fun GrapesBucketHeadline(
4344
if (action != null && actionColor != null) {
4445
Spacer(modifier = Modifier.size(GrapesTheme.dimensions.unit12))
4546
Text(
46-
modifier = Modifier.clickable(onClick = onActionClicked ?: {}, onClickLabel = action, role = Role.Button),
47+
modifier = Modifier.clickable(onClick = onActionClicked ?: {}, onClickLabel = action, role = Role.Button, enabled = actionEnabled),
4748
text = action,
4849
color = actionColor,
4950
overflow = TextOverflow.Ellipsis,

0 commit comments

Comments
 (0)