Add word button on glossary detailed view

main
CAPEL Maxime 2024-01-12 09:58:35 +01:00
parent 1d031fe96c
commit f611891c09
2 changed files with 9 additions and 3 deletions

View File

@ -9,7 +9,7 @@ import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@ -19,7 +19,11 @@ import androidx.compose.ui.unit.dp
import main.component.buttonComponent
@Composable
fun glossaryDetailedPage(glossary: List<Word>, onBackClick: () -> Unit) {
fun glossaryDetailedPage(
glossary: List<Word>,
onBackClick: () -> Unit,
onAddWordClick: () -> Unit
) {
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Top, // Align content at the top
@ -34,6 +38,7 @@ fun glossaryDetailedPage(glossary: List<Word>, onBackClick: () -> Unit) {
Spacer(modifier = Modifier.height(16.dp))
buttonComponent(text = "Retour", onClick = { onBackClick() }, icon = Icons.Filled.ArrowBack, width = 150)
buttonComponent(text = "Ajouter un mot", onClick = { onAddWordClick() }, icon = Icons.Filled.Add, width = 150)
}
}

View File

@ -330,7 +330,8 @@ fun app() {
"glossaireDetail" -> {
glossaryDetailedPage(
glossary = glossaryDetail,
onBackClick = { currentPage.value = "glossaireOptions" }
onBackClick = { currentPage.value = "glossaireOptions" },
onAddWordClick = { currentPage.value = "formulaire" },
)
}