Skip to content

Commit

Permalink
Release/version 1.0.0.alpha.5 (#1002)
Browse files Browse the repository at this point in the history
* Release Version-1.0.0-alpha.5

Bug Fix: Fixed HomeScreen Bug
- Close #997

* Fix: Fixed bug on AddEditCartOrderScreen

- Close #982

* Enhancement - Delivery Partner Details Screen

- Close #1000

* Feat: Bug Fix & Enhancement

- Close #999
- Close #982

* 🤖 Updates screenshots

* Refactor - Update Order List UI in Address Screen

- Updated background color of grouped orders.
- Removed unnecessary Surface from ListOfOrders.
- Added
 background color parameter to ListOfOrders.
- Removed extra space and divider between orders in ListOfOrders.
- Close #1001

---------

Co-authored-by: niyajali <niyajali@users.noreply.github.com>
  • Loading branch information
niyajali and niyajali authored Jul 30, 2024
1 parent cf7c306 commit eea58c4
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ import com.niyaj.ui.utils.DevicePreviews

@Composable
internal fun GroupedOrders(
modifier: Modifier = Modifier,
customerPhone: String,
orderDetails: List<AddressWiseOrder>,
onClickOrder: (Int) -> Unit,
) = trace("Address::GroupedOrders") {
Column(
modifier = Modifier
modifier = modifier
.fillMaxWidth(),
) {
Row(
Expand Down Expand Up @@ -117,7 +118,7 @@ private fun GroupedOrderDetails(
FlowRow(
modifier = modifier
.fillMaxWidth()
.background(MaterialTheme.colorScheme.tertiaryContainer)
.background(MaterialTheme.colorScheme.surfaceContainerLow)
.padding(horizontal = SpaceSmall),
horizontalArrangement = Arrangement.spacedBy(SpaceSmall, Alignment.Start),
verticalArrangement = Arrangement.Center,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.key
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.util.trace
Expand All @@ -48,74 +49,72 @@ import com.niyaj.ui.utils.DevicePreviews

@Composable
internal fun ListOfOrders(
modifier: Modifier = Modifier,
orderSize: Int,
orderDetails: List<AddressWiseOrder>,
onClickOrder: (Int) -> Unit,
modifier: Modifier = Modifier,
backgroundColor: Color = MaterialTheme.colorScheme.background,
) = trace("Address::ListOfOrder") {
Surface(modifier) {
Column(
modifier = Modifier
.fillMaxWidth(),
) {
orderDetails.forEachIndexed { index, order ->
key(order.orderId) {
Surface(
Column(
modifier = modifier
.fillMaxWidth(),
) {
orderDetails.forEachIndexed { index, order ->
key(order.orderId) {
Surface(
modifier = Modifier
.fillMaxWidth(),
color = backgroundColor,
onClick = {
onClickOrder(order.orderId)
},
) {
Row(
modifier = Modifier
.fillMaxWidth(),
onClick = {
onClickOrder(order.orderId)
},
.fillMaxWidth()
.padding(SpaceSmall),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
) {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(SpaceSmall),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
) {
IconWithText(
text = "${order.orderId}",
icon = PoposIcons.Tag,
tintColor = MaterialTheme.colorScheme.tertiary,
isTitle = true,
)

Column {
Text(
text = order.customerPhone,
textAlign = TextAlign.Start,
)

order.customerName?.let {
Spacer(
modifier = Modifier.height(
SpaceMini,
),
)
Text(text = it)
}
}
IconWithText(
text = "${order.orderId}",
icon = PoposIcons.Tag,
tintColor = MaterialTheme.colorScheme.tertiary,
isTitle = true,
)

Column {
Text(
text = order.totalPrice.toRupee,
text = order.customerPhone,
textAlign = TextAlign.Start,
fontWeight = FontWeight.SemiBold,
)

Text(
text = order.updatedAt.toTime,
textAlign = TextAlign.End,
)
order.customerName?.let {
Spacer(
modifier = Modifier.height(
SpaceMini,
),
)
Text(text = it)
}
}

Text(
text = order.totalPrice.toRupee,
textAlign = TextAlign.Start,
fontWeight = FontWeight.SemiBold,
)

Text(
text = order.updatedAt.toTime,
textAlign = TextAlign.End,
)
}
}
}

if (index != orderSize - 1) {
Spacer(modifier = Modifier.height(SpaceMini))
HorizontalDivider(modifier = Modifier.fillMaxWidth())
Spacer(modifier = Modifier.height(SpaceMini))
}
if (index != orderSize - 1) {
HorizontalDivider(modifier = Modifier.fillMaxWidth())
}
}
}
Expand Down

0 comments on commit eea58c4

Please sign in to comment.