Skip to content

Commit 71bf4f8

Browse files
Hide attendance status tag if Unknown
1 parent f69c029 commit 71bf4f8

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/BookingAttendanceStatusTag.kt

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,35 @@ fun BookingAttendanceStatusTag(
3636
) {
3737
val density = LocalDensity.current
3838
var skeletonSize by remember { mutableStateOf(DpSize.Zero) }
39-
Box(modifier = modifier) {
40-
when (attendanceUpdateStatus) {
41-
AttendanceUpdateStatus.InProgress -> {
42-
SkeletonView(
43-
modifier = Modifier
44-
.clip(RoundedCornerShape(4.dp))
45-
.sizeIn(
46-
minHeight = 20.dp,
47-
maxWidth = 80.dp
48-
)
49-
.size(skeletonSize)
50-
)
51-
}
39+
if (state !is BookingAttendanceStatus.Unknown) {
40+
Box(modifier = modifier) {
41+
when (attendanceUpdateStatus) {
42+
AttendanceUpdateStatus.InProgress -> {
43+
SkeletonView(
44+
modifier = Modifier
45+
.clip(RoundedCornerShape(4.dp))
46+
.sizeIn(
47+
minHeight = 20.dp,
48+
maxWidth = 80.dp
49+
)
50+
.size(skeletonSize)
51+
)
52+
}
5253

53-
AttendanceUpdateStatus.Idle -> {
54-
WCTag(
55-
text = state.text(),
56-
backgroundColor = state.backgroundColor(),
57-
textColor = colorResource(R.color.tagView_text),
58-
fontWeight = FontWeight.Normal,
59-
modifier = Modifier
60-
.onSizeChanged {
61-
with(density) {
62-
skeletonSize = DpSize(it.width.toDp(), it.height.toDp())
54+
AttendanceUpdateStatus.Idle -> {
55+
WCTag(
56+
text = state.text(),
57+
backgroundColor = state.backgroundColor(),
58+
textColor = colorResource(R.color.tagView_text),
59+
fontWeight = FontWeight.Normal,
60+
modifier = Modifier
61+
.onSizeChanged {
62+
with(density) {
63+
skeletonSize = DpSize(it.width.toDp(), it.height.toDp())
64+
}
6365
}
64-
}
65-
)
66+
)
67+
}
6668
}
6769
}
6870
}

0 commit comments

Comments
 (0)