Merge remote-tracking branch 'origin/master'

This commit is contained in:
Nikolay Odegov 2025-02-18 20:35:06 +03:00
commit 9257dfa692
5 changed files with 52 additions and 14 deletions

View File

@ -2,7 +2,7 @@ package com.nto.data.models.cards
data class VisitCardDTO( data class VisitCardDTO(
val name: String = "", val name: String = "",
val id: String, val id: String = "",
val dateString: String, val dateString: String = "",
val isCode: Boolean val isCode: Boolean = false
) )

View File

@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
@ -12,32 +13,64 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.nto.data.models.cards.VisitCardDTO
import com.nto.presentation.R
import com.nto.presentation.theme.NTOTheme import com.nto.presentation.theme.NTOTheme
@Composable @Composable
fun VisitCard(modifier: Modifier = Modifier) { fun VisitCard(data: VisitCardDTO, modifier: Modifier = Modifier) {
Row( Row(
modifier = modifier modifier = modifier
.width(365.dp) .width(365.dp)
.height(70.dp) .height(70.dp)
.clip(RoundedCornerShape(10.dp)) .clip(RoundedCornerShape(10.dp))
.background(NTOTheme.colors.inputFieldBackground) .background(NTOTheme.colors.inputFieldBackground),
) { ) {
Row( Row(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxSize()
.padding(start = 15.dp, end = 15.dp), .padding(start = 15.dp, end = 15.dp),
horizontalArrangement = Arrangement.SpaceBetween horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) { ) {
Column { Column(horizontalAlignment = Alignment.Start) {
Text("") Text(
Spacer(modifier = Modifier.height(15.dp)) text = data.name,
style = NTOTheme.typography.displaySmall,
fontSize = 12.sp,
fontWeight = FontWeight.Bold
)
Spacer(modifier = Modifier.height(10.dp))
Text(
text = data.id,
style = NTOTheme.typography.displaySmall,
fontSize = 12.sp,
fontWeight = FontWeight.Thin
)
}
Column(horizontalAlignment = Alignment.End) {
Text(
text = data.dateString,
style = NTOTheme.typography.displaySmall,
fontSize = 12.sp,
color = NTOTheme.colors.disabledText
)
Spacer(modifier = Modifier.height(10.dp))
Text(
text = stringResource(if (data.isCode) R.string.qr_login_label else R.string.card_login_label),
style = NTOTheme.typography.displaySmall,
fontSize = 12.sp,
color = NTOTheme.colors.disabledText
)
} }
Column { }
} }
} }
} }
@ -46,6 +79,6 @@ fun VisitCard(modifier: Modifier = Modifier) {
@Composable @Composable
private fun VisitCardPreview() { private fun VisitCardPreview() {
NTOTheme { NTOTheme {
VisitCard() VisitCard(VisitCardDTO("Кабинет 207", "id: 129008", "24 января 20:01"))
} }
} }

View File

@ -146,7 +146,7 @@ fun ProfileScreen(
.fillMaxWidth() .fillMaxWidth()
.height(50.dp) .height(50.dp)
) { ) {
viewModel.scan(navController)
} }
} }
} }

View File

@ -1,10 +1,13 @@
package com.nto.presentation.screens.profileScreen package com.nto.presentation.screens.profileScreen
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import androidx.navigation.NavController
import dagger.hilt.android.lifecycle.HiltViewModel import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject import javax.inject.Inject
@HiltViewModel @HiltViewModel
class ProfileViewModel @Inject constructor() : ViewModel() { class ProfileViewModel @Inject constructor() : ViewModel() {
fun scan(navController: NavController) {
//TODO
}
} }

View File

@ -8,4 +8,6 @@
<string name="placholder_email" translatable="false">example@mail.com</string> <string name="placholder_email" translatable="false">example@mail.com</string>
<string name="placeholder_password" translatable="false">**********</string> <string name="placeholder_password" translatable="false">**********</string>
<string name="title_profile">Профиль</string> <string name="title_profile">Профиль</string>
<string name="qr_login_label">Вход по коду</string>
<string name="card_login_label">Вход по карте</string>
</resources> </resources>