Skip to content

Commit

Permalink
💄 MenuItemCard UI
Browse files Browse the repository at this point in the history
  • Loading branch information
hitanshu-dhawan committed Nov 27, 2020
1 parent 55af628 commit 904bb75
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ import com.hitanshudhawan.mccompose.model.MenuItem
import com.hitanshudhawan.mccompose.ui.theme.McComposeTheme
import dev.chrisbanes.accompanist.coil.CoilImage

// TODO...
// Styling
// 1. Bold, Color etc. of texts
// Logic
// 1. Menu item price formatting and color, maybe green

@Composable
fun MenuItemCard(
menuItem: MenuItem,
Expand All @@ -49,8 +43,8 @@ fun MenuItemCard(
Surface(
modifier = Modifier
.constrainAs(card) {
start.linkTo(parent.start, margin = 16.dp) // todo : 16 dp get from outside or global horizontal padding
end.linkTo(parent.end, margin = 16.dp) // todo : 16 dp get from outside or global horizontal padding
start.linkTo(parent.start, margin = 16.dp)
end.linkTo(parent.end, margin = 16.dp)
top.linkTo(parent.top, margin = 32.dp)
bottom.linkTo(parent.bottom)

Expand Down Expand Up @@ -79,7 +73,7 @@ fun MenuItemCard(
)

Text(
text = "$" + "9.99",
text = "$" + "%.2f".format(menuItem.price),
style = MaterialTheme.typography.subtitle2,
modifier = Modifier
.constrainAs(price) {
Expand Down

0 comments on commit 904bb75

Please sign in to comment.