Красиво вынесли. Осталась страничку пользователя и отчеты
This commit is contained in:
parent
361caca3c8
commit
194dab430b
@ -58,6 +58,7 @@ import com.example.myapplication.database.entities.composeui.AppViewModelProvide
|
||||
import com.example.myapplication.database.entities.composeui.CartUiState
|
||||
import com.example.myapplication.database.entities.composeui.CartViewModel
|
||||
import com.example.myapplication.database.entities.composeui.CurrentUserViewModel
|
||||
import com.example.myapplication.database.entities.composeui.ErroreList
|
||||
import com.example.myapplication.database.entities.model.Item
|
||||
import com.example.myapplication.database.entities.model.ItemFromCart
|
||||
import com.example.myapplication.ui.theme.PmudemoTheme
|
||||
@ -121,27 +122,9 @@ fun Cart(
|
||||
}
|
||||
)
|
||||
} else {
|
||||
// Пользователь не авторизован, показываем экран с сообщением
|
||||
UnauthorizedScreen()
|
||||
ErroreList()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun UnauthorizedScreen() {
|
||||
// Экран с сообщением о неудачной авторизации
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(16.dp),
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Text("Oops! Something went wrong.", fontWeight = FontWeight.Bold)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Text("Please try again later.")
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
private fun Cart(
|
||||
|
@ -105,7 +105,7 @@ fun BikeList(
|
||||
)
|
||||
}
|
||||
} else {
|
||||
UnauthorizedScreen()
|
||||
ErroreList()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,29 @@
|
||||
package com.example.myapplication.database.entities.composeui
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
fun ErroreList() {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(16.dp),
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Text("На данный момент страница не доступна.", fontWeight = FontWeight.Bold)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Text("Пожалуйста, пройдите авторизацию.")
|
||||
}
|
||||
}
|
@ -105,22 +105,7 @@ fun RentList(
|
||||
}
|
||||
} else {
|
||||
// Пользователь не авторизован, показываем экран с сообщением
|
||||
UnauthorizedScreen()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun UnauthorizedScreen() {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(16.dp),
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Text("Oops! Something went wrong.", fontWeight = FontWeight.Bold)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Text("Please try again later.")
|
||||
ErroreList()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,32 +54,6 @@
|
||||
}
|
||||
],
|
||||
"rents": [
|
||||
{
|
||||
"id": 6,
|
||||
"userId": 2,
|
||||
"items": [
|
||||
{
|
||||
"id": 1,
|
||||
"dateTime": 2021,
|
||||
"frozenWeight": 26.6,
|
||||
"count": 2,
|
||||
"bikeId": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"userId": 2,
|
||||
"items": [
|
||||
{
|
||||
"id": 4,
|
||||
"dateTime": 2023,
|
||||
"frozenWeight": 26.3,
|
||||
"count": 2,
|
||||
"bikeId": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"userId": 7,
|
||||
|
Loading…
Reference in New Issue
Block a user