Added home page
parent
2a671dfe2d
commit
a8335f51e3
|
@ -1,45 +1,84 @@
|
||||||
import androidx.compose.desktop.ui.tooling.preview.Preview
|
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.Composable
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.window.Window
|
import androidx.compose.ui.window.Window
|
||||||
import androidx.compose.ui.window.application
|
import androidx.compose.ui.window.application
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.material.TextField
|
import androidx.compose.material.*
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
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
|
@Composable
|
||||||
@Preview
|
@Preview
|
||||||
fun App() {
|
fun App() {
|
||||||
|
MaterialTheme {
|
||||||
MaterialTheme {
|
|
||||||
val currentPage = remember { mutableStateOf("accueil") }
|
val currentPage = remember { mutableStateOf("accueil") }
|
||||||
|
|
||||||
when (currentPage.value) {
|
when (currentPage.value) {
|
||||||
"accueil" -> {
|
"accueil" -> {
|
||||||
AccueilPage(
|
HomePage(
|
||||||
|
onGlossaireClick = { currentPage.value = "glossaire" }
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
||||||
|
"glossaire" -> {
|
||||||
|
glossairePage(
|
||||||
onAjouterMotClick = { currentPage.value = "formulaire" },
|
onAjouterMotClick = { currentPage.value = "formulaire" },
|
||||||
onImporterClick = { /* Action d'importation */ },
|
onImporterClick = { /* Action d'import */ },
|
||||||
onExporterClick = { /* Action d'exportation */ }
|
onExporterClick = { /* Action d'export */ },
|
||||||
|
onRetourClick = { currentPage.value = "accueil" }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
"formulaire" -> {
|
"formulaire" -> {
|
||||||
FormulairePage(onAnnulerClick = { currentPage.value = "accueil" })
|
FormulairePage(onAnnulerClick = { currentPage.value = "glossaire" })
|
||||||
|
}
|
||||||
|
// ... Ajoutez d'autres cas pour les pages "glossaire," "code a verifier," et "comparer"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AccueilPage(
|
fun glossairePage(
|
||||||
onAjouterMotClick: () -> Unit,
|
onAjouterMotClick: () -> Unit,
|
||||||
onImporterClick: () -> Unit,
|
onImporterClick: () -> Unit,
|
||||||
onExporterClick: () -> Unit
|
onExporterClick: () -> Unit,
|
||||||
|
onRetourClick: () -> Unit
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
@ -62,9 +101,17 @@ fun AccueilPage(
|
||||||
Button(onClick = onExporterClick) {
|
Button(onClick = onExporterClick) {
|
||||||
Text("Exporter un fichier CSV")
|
Text("Exporter un fichier CSV")
|
||||||
}
|
}
|
||||||
|
//Ajoute un bouton retour
|
||||||
|
Button(onClick = onRetourClick) {
|
||||||
|
Text("Retour")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun FormulairePage(onAnnulerClick: () -> Unit) {
|
fun FormulairePage(onAnnulerClick: () -> Unit) {
|
||||||
MaterialTheme {
|
MaterialTheme {
|
||||||
|
@ -129,9 +176,11 @@ fun FormulairePage(onAnnulerClick: () -> Unit) {
|
||||||
horizontalArrangement = Arrangement.SpaceEvenly
|
horizontalArrangement = Arrangement.SpaceEvenly
|
||||||
) {
|
) {
|
||||||
Button(onClick = onAnnulerClick) {
|
Button(onClick = onAnnulerClick) {
|
||||||
|
Icon(imageVector = Icons.Default.Close, contentDescription = null)
|
||||||
Text("Annuler")
|
Text("Annuler")
|
||||||
}
|
}
|
||||||
Button(onClick = { /* Action de validation */ }) {
|
Button(onClick = { /* Action de validation */ }) {
|
||||||
|
Icon(imageVector = Icons.Default.Check, contentDescription = null)
|
||||||
Text("Valider")
|
Text("Valider")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue