Начинаем делать экран продуктов + ранние фиксы

This commit is contained in:
Данила Мочалов 2023-11-08 04:34:27 +04:00
parent 761d76d4aa
commit 58962faf89
5 changed files with 5 additions and 5 deletions

View File

@ -20,7 +20,7 @@ interface OrderDao {
@Delete @Delete
suspend fun delete(order: OrderModel) suspend fun delete(order: OrderModel)
@Query("select * from orders where orders.user_id is not null") @Query("select * from orders")
fun getAll() : Flow<List<OrderWithProducts>> fun getAll() : Flow<List<OrderWithProducts>>
@Query("select * from orders where orders.id =:id") @Query("select * from orders where orders.id =:id")
fun getById(id: Int): Flow<List<OrderWithProducts>> fun getById(id: Int): Flow<List<OrderWithProducts>>

View File

@ -36,10 +36,7 @@ import androidx.compose.ui.unit.sp
import androidx.compose.ui.zIndex import androidx.compose.ui.zIndex
import com.example.shawarma.R import com.example.shawarma.R
import com.example.shawarma.data.db.AppDatabase import com.example.shawarma.data.db.AppDatabase
import com.example.shawarma.data.models.DiscountProductModel
import com.example.shawarma.data.models.ProductModel import com.example.shawarma.data.models.ProductModel
import com.example.shawarma.data.models.getAllDiscountProducts
import com.example.shawarma.screens.home.HomeList
import com.example.shawarma.ui.theme.MarckFamily import com.example.shawarma.ui.theme.MarckFamily
import com.example.shawarma.ui.theme.MyLightYellow import com.example.shawarma.ui.theme.MyLightYellow
import com.example.shawarma.ui.theme.MyMainBackground import com.example.shawarma.ui.theme.MyMainBackground
@ -149,6 +146,7 @@ fun DiscountCard(product : ProductModel){
.size(160.dp, 36.dp) .size(160.dp, 36.dp)
) { ) {
Row( Row(
horizontalArrangement = Arrangement.SpaceBetween
){ ){
Box( Box(
modifier = Modifier.padding(start = 12.dp) modifier = Modifier.padding(start = 12.dp)

View File

@ -7,4 +7,6 @@ sealed class BottomNavItem(var title:String, var icon:Int, var screen_route:Stri
object Discount : BottomNavItem("Discount", R.drawable.discount_icon,ScreenPaths.discount.name) object Discount : BottomNavItem("Discount", R.drawable.discount_icon,ScreenPaths.discount.name)
object Cart : BottomNavItem("Cart", R.drawable.cart_icon,ScreenPaths.cart.name) object Cart : BottomNavItem("Cart", R.drawable.cart_icon,ScreenPaths.cart.name)
object Orders: BottomNavItem("Orders", R.drawable.orders_icon,ScreenPaths.orders.name) object Orders: BottomNavItem("Orders", R.drawable.orders_icon,ScreenPaths.orders.name)
object Products: BottomNavItem("Products", R.drawable.pen_icon, ScreenPaths.products.name)
} }

View File

@ -1,5 +1,5 @@
package com.example.shawarma.utils package com.example.shawarma.utils
enum class ScreenPaths { enum class ScreenPaths {
authorization, registration, home, discount, cart, orders authorization, registration, home, discount, cart, orders, products
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB