Skip to content

Commit 2ec9bef

Browse files
authored
Merge pull request #14576 from woocommerce/issue/WOOMOB-12-make-selected-hazmat-box-tappable
[Shipping Labels] Make selected hazmat box tappable
2 parents 986909c + ba5afe7 commit 2ec9bef

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- [*] Automatically populate the weight field in the create shipment flow [https://github.com/woocommerce/woocommerce-android/pull/14525]
2121
- [*] [Shipping Labels] Fixed displaying incorrect hazardous material option for purchased labels [https://github.com/woocommerce/woocommerce-android/pull/14571]
2222
- [*] Shipping Labels: Updated the disabled button text on the package selection screen [https://github.com/woocommerce/woocommerce-android/pull/14558]
23+
- [*] Enhance the shipping label creation screen by making the selected hazardous box tappable [https://github.com/woocommerce/woocommerce-android/pull/14576]
2324

2425
23.1
2526
-----

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/wooshippinglabels/hazmat/HazmatCard.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ internal fun HazmatCard(
7171
if (selectedCategory != null) {
7272
HazmatSelectionCard(
7373
selectedCategory = selectedCategory,
74+
onClick = onClick,
7475
modifier = Modifier.padding(dimensionResource(id = R.dimen.major_100))
7576
)
7677
}

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/wooshippinglabels/hazmat/HazmatSelectionCard.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.woocommerce.android.ui.orders.wooshippinglabels.hazmat
22

33
import androidx.compose.foundation.background
4+
import androidx.compose.foundation.clickable
45
import androidx.compose.foundation.layout.Box
56
import androidx.compose.foundation.layout.Spacer
67
import androidx.compose.foundation.layout.fillMaxWidth
@@ -11,6 +12,7 @@ import androidx.compose.material3.MaterialTheme
1112
import androidx.compose.material3.Text
1213
import androidx.compose.runtime.Composable
1314
import androidx.compose.ui.Modifier
15+
import androidx.compose.ui.draw.clip
1416
import androidx.compose.ui.res.colorResource
1517
import androidx.compose.ui.res.dimensionResource
1618
import androidx.compose.ui.res.stringResource
@@ -21,17 +23,17 @@ import com.woocommerce.android.ui.orders.shippinglabels.creation.ShippingLabelHa
2123
@Composable
2224
fun HazmatSelectionCard(
2325
selectedCategory: ShippingLabelHazmatCategory,
24-
modifier: Modifier = Modifier
26+
modifier: Modifier = Modifier,
27+
onClick: OnClick? = null,
2528
) {
2629
Spacer(modifier = Modifier.height(4.dp))
2730
Box(modifier = modifier) {
2831
Box(
2932
modifier = Modifier
3033
.fillMaxWidth()
31-
.background(
32-
color = colorResource(R.color.light_colored_button_background),
33-
shape = RoundedCornerShape(dimensionResource(R.dimen.corner_radius_large))
34-
)
34+
.clip(RoundedCornerShape(dimensionResource(R.dimen.corner_radius_large)))
35+
.then(if (onClick == null) Modifier else Modifier.clickable { onClick() })
36+
.background(color = colorResource(R.color.light_colored_button_background))
3537
.padding(16.dp)
3638
) {
3739
Text(

0 commit comments

Comments
 (0)