Added home page

main
Cemal Odabasioglu 2023-11-07 14:48:46 +01:00
parent 2a671dfe2d
commit a8335f51e3
1 changed files with 68 additions and 19 deletions

View File

@ -1,45 +1,84 @@
import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.material.Button
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import androidx.compose.foundation.layout.*
import androidx.compose.material.TextField
import androidx.compose.material.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Check
import androidx.compose.material.icons.filled.Close
@Composable
fun HomePage(onGlossaireClick: () -> Unit) {
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
Text("Quali'Nomme", style = MaterialTheme.typography.h3)
Spacer(modifier = Modifier.height(16.dp))
Row(
horizontalArrangement = Arrangement.spacedBy(16.dp)
) {
Button(onClick = onGlossaireClick) {
Text("Glossaire")
}
Button(onClick = { /* Action de Code à Vérifier */ }) {
Text("Code à Vérifier")
}
Button(onClick = { /* Action de Comparer */ }) {
Text("Comparer")
}
}
}
}
@Composable
@Preview
fun App() {
MaterialTheme {
val currentPage = remember { mutableStateOf("accueil") }
MaterialTheme {
val currentPage = remember { mutableStateOf("accueil") }
when (currentPage.value) {
"accueil" -> {
HomePage(
onGlossaireClick = { currentPage.value = "glossaire" }
when (currentPage.value) {
"accueil" -> {
AccueilPage(
onAjouterMotClick = { currentPage.value = "formulaire" },
onImporterClick = { /* Action d'importation */ },
onExporterClick = { /* Action d'exportation */ }
)
}
"formulaire" -> {
FormulairePage(onAnnulerClick = { currentPage.value = "accueil" })
)
}
"glossaire" -> {
glossairePage(
onAjouterMotClick = { currentPage.value = "formulaire" },
onImporterClick = { /* Action d'import */ },
onExporterClick = { /* Action d'export */ },
onRetourClick = { currentPage.value = "accueil" }
)
}
"formulaire" -> {
FormulairePage(onAnnulerClick = { currentPage.value = "glossaire" })
}
// ... Ajoutez d'autres cas pour les pages "glossaire," "code a verifier," et "comparer"
}
}
}
}
@Composable
fun AccueilPage(
fun glossairePage(
onAjouterMotClick: () -> Unit,
onImporterClick: () -> Unit,
onExporterClick: () -> Unit
onExporterClick: () -> Unit,
onRetourClick: () -> Unit
) {
Column(
modifier = Modifier
@ -62,9 +101,17 @@ fun AccueilPage(
Button(onClick = onExporterClick) {
Text("Exporter un fichier CSV")
}
//Ajoute un bouton retour
Button(onClick = onRetourClick) {
Text("Retour")
}
}
}
@Composable
fun FormulairePage(onAnnulerClick: () -> Unit) {
MaterialTheme {
@ -129,9 +176,11 @@ fun FormulairePage(onAnnulerClick: () -> Unit) {
horizontalArrangement = Arrangement.SpaceEvenly
) {
Button(onClick = onAnnulerClick) {
Icon(imageVector = Icons.Default.Close, contentDescription = null)
Text("Annuler")
}
Button(onClick = { /* Action de validation */ }) {
Icon(imageVector = Icons.Default.Check, contentDescription = null)
Text("Valider")
}
}