@@ -268,18 +268,20 @@ private fun BookingListControls(
268268 tint = MaterialTheme .colorScheme.onSurfaceVariant
269269 )
270270 }
271- OutlinedButton (
272- modifier = Modifier .defaultMinSize(minWidth = 88 .dp, minHeight = 36 .dp),
273- contentPadding = PaddingValues (horizontal = 16 .dp),
274- colors = ButtonDefaults .outlinedButtonColors().copy(
275- contentColor = MaterialTheme .colorScheme.onSurface.copy(alpha = 0.6f )
276- ),
277- onClick = state.onFilterClick,
278- ) {
279- Text (
280- text = stringResource(R .string.bookings_filters_default_title),
281- style = MaterialTheme .typography.bodyMedium,
282- )
271+ if (state.isFilterButtonVisible) {
272+ OutlinedButton (
273+ modifier = Modifier .defaultMinSize(minWidth = 88 .dp, minHeight = 36 .dp),
274+ contentPadding = PaddingValues (horizontal = 16 .dp),
275+ colors = ButtonDefaults .outlinedButtonColors().copy(
276+ contentColor = MaterialTheme .colorScheme.onSurface.copy(alpha = 0.6f )
277+ ),
278+ onClick = state.onFilterClick,
279+ ) {
280+ Text (
281+ text = stringResource(R .string.bookings_filters_default_title),
282+ style = MaterialTheme .typography.bodyMedium,
283+ )
284+ }
283285 }
284286 }
285287}
@@ -321,6 +323,7 @@ private fun BookingListPreview() {
321323 ),
322324 controlsState = BookingListControlsState (
323325 selectedSortOption = BookingListSortOption .NewestToOldest ,
326+ isFilterButtonVisible = true ,
324327 onSortClick = {},
325328 onFilterClick = {}
326329 ),
0 commit comments