diff --git a/data/src/main/java/com/nto/data/models/cards/VisitCardDTO.kt b/data/src/main/java/com/nto/data/models/cards/VisitCardDTO.kt
index 03631e4..298be16 100644
--- a/data/src/main/java/com/nto/data/models/cards/VisitCardDTO.kt
+++ b/data/src/main/java/com/nto/data/models/cards/VisitCardDTO.kt
@@ -2,7 +2,7 @@ package com.nto.data.models.cards
data class VisitCardDTO(
val name: String = "",
- val id: String,
- val dateString: String,
- val isCode: Boolean
+ val id: String = "",
+ val dateString: String = "",
+ val isCode: Boolean = false
)
diff --git a/presentation/src/main/java/com/nto/presentation/composable/cards/VisitCard.kt b/presentation/src/main/java/com/nto/presentation/composable/cards/VisitCard.kt
index 32a17db..576aef3 100644
--- a/presentation/src/main/java/com/nto/presentation/composable/cards/VisitCard.kt
+++ b/presentation/src/main/java/com/nto/presentation/composable/cards/VisitCard.kt
@@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
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.material3.Text
import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
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.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
@Composable
-fun VisitCard(modifier: Modifier = Modifier) {
+fun VisitCard(data: VisitCardDTO, modifier: Modifier = Modifier) {
Row(
modifier = modifier
.width(365.dp)
.height(70.dp)
.clip(RoundedCornerShape(10.dp))
- .background(NTOTheme.colors.inputFieldBackground)
+ .background(NTOTheme.colors.inputFieldBackground),
) {
Row(
modifier = Modifier
- .fillMaxWidth()
+ .fillMaxSize()
.padding(start = 15.dp, end = 15.dp),
- horizontalArrangement = Arrangement.SpaceBetween
+ horizontalArrangement = Arrangement.SpaceBetween,
+ verticalAlignment = Alignment.CenterVertically
) {
- Column {
- Text("")
- Spacer(modifier = Modifier.height(15.dp))
+ Column(horizontalAlignment = Alignment.Start) {
+ Text(
+ 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
private fun VisitCardPreview() {
NTOTheme {
- VisitCard()
+ VisitCard(VisitCardDTO("Кабинет 207", "id: 129008", "24 января 20:01"))
}
}
\ No newline at end of file
diff --git a/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileScreen.kt b/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileScreen.kt
index 0408f2a..bbb2eb2 100644
--- a/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileScreen.kt
+++ b/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileScreen.kt
@@ -146,7 +146,7 @@ fun ProfileScreen(
.fillMaxWidth()
.height(50.dp)
) {
-
+ viewModel.scan(navController)
}
}
}
diff --git a/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileViewModel.kt b/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileViewModel.kt
index a99a953..6f51cb8 100644
--- a/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileViewModel.kt
+++ b/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileViewModel.kt
@@ -1,10 +1,13 @@
package com.nto.presentation.screens.profileScreen
import androidx.lifecycle.ViewModel
+import androidx.navigation.NavController
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject
@HiltViewModel
class ProfileViewModel @Inject constructor() : ViewModel() {
-
+ fun scan(navController: NavController) {
+ //TODO
+ }
}
\ No newline at end of file
diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml
index c3a785a..cd78983 100644
--- a/presentation/src/main/res/values/strings.xml
+++ b/presentation/src/main/res/values/strings.xml
@@ -8,4 +8,6 @@
example@mail.com
**********
Профиль
+ Вход по коду
+ Вход по карте
\ No newline at end of file