11package to.bitkit.ui.components
22
3- import to.bitkit.R
43import androidx.compose.foundation.border
54import androidx.compose.foundation.clickable
65import androidx.compose.foundation.layout.Arrangement
76import androidx.compose.foundation.layout.Column
87import androidx.compose.foundation.layout.ExperimentalLayoutApi
9- import androidx.compose.foundation.layout.FlowRow
108import androidx.compose.foundation.layout.Row
119import androidx.compose.foundation.layout.padding
1210import androidx.compose.foundation.layout.wrapContentWidth
@@ -21,6 +19,7 @@ import androidx.compose.ui.res.painterResource
2119import androidx.compose.ui.text.font.FontWeight
2220import androidx.compose.ui.tooling.preview.Preview
2321import androidx.compose.ui.unit.dp
22+ import to.bitkit.R
2423import to.bitkit.ui.theme.AppThemeSurface
2524import to.bitkit.ui.theme.Colors
2625
@@ -54,11 +53,13 @@ fun TagButton(
5453 fontWeight = FontWeight .Medium ,
5554 )
5655
57- Icon (
58- painter = painterResource(R .drawable.ic_x),
59- contentDescription = null ,
60- tint = Colors .White
61- )
56+ if (displayIconClose) {
57+ Icon (
58+ painter = painterResource(R .drawable.ic_x),
59+ contentDescription = null ,
60+ tint = Colors .White
61+ )
62+ }
6263 }
6364}
6465
@@ -71,8 +72,8 @@ private fun Preview() {
7172 Column (verticalArrangement = Arrangement .spacedBy(8 .dp)) {
7273 TagButton (" Selected" , isSelected = true , onClick = {})
7374 TagButton (" Not Selected" , isSelected = false , onClick = {})
74- TagButton (" Selected With icon close" , isSelected = true , onClick = {})
75- TagButton (" Not Selected With icon close" , isSelected = false , onClick = {})
75+ TagButton (" Selected With icon close" , displayIconClose = true , isSelected = true , onClick = {})
76+ TagButton (" Not Selected With icon close" , displayIconClose = true , isSelected = false , onClick = {})
7677 }
7778 }
7879}
0 commit comments