mirror of
https://github.com/AdrianKuta/KahootQuiz.git
synced 2025-09-14 17:24:21 +02:00
feat: Display Quiz ID in QuizScreen and integrate with navigation
This commit updates the `QuizScreen` to display the ID of the fetched quiz and connects the `QuizScreen` composable to the navigation graph. Key changes: - **UI Layer (`ui:quiz` module):** - In `QuizScreen.kt`: - Modified the `QuizScreen` composable to display the `quiz.id.value` from the `QuizUiState` within a `Column` and `Text` element. - In `navigation/QuizNavigation.kt`: - Updated the `quizScreen` navigation extension to call the `QuizScreen()` composable.
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package dev.adriankuta.kahootquiz.ui.quiz
|
package dev.adriankuta.kahootquiz.ui.quiz
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@@ -25,5 +27,7 @@ private fun QuizScreen(
|
|||||||
uiState: QuizUiState,
|
uiState: QuizUiState,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
|
Column(modifier) {
|
||||||
|
Text(uiState.quiz?.id?.value ?: "")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,7 @@ package dev.adriankuta.kahootquiz.ui.quiz.navigation
|
|||||||
|
|
||||||
import androidx.navigation.NavGraphBuilder
|
import androidx.navigation.NavGraphBuilder
|
||||||
import androidx.navigation.compose.composable
|
import androidx.navigation.compose.composable
|
||||||
|
import dev.adriankuta.kahootquiz.ui.quiz.QuizScreen
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -9,6 +10,6 @@ data object QuizRoute
|
|||||||
|
|
||||||
fun NavGraphBuilder.quizScreen() {
|
fun NavGraphBuilder.quizScreen() {
|
||||||
composable<QuizRoute> {
|
composable<QuizRoute> {
|
||||||
|
QuizScreen()
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user