Use buttonComponent on Home.kt

main
CAPEL Maxime 2023-12-21 14:56:31 +01:00
parent 34656cfac3
commit 5a943d4d9f
1 changed files with 5 additions and 56 deletions

View File

@ -90,15 +90,7 @@ fun homePage(
Snackbar( Snackbar(
modifier = Modifier.padding(16.dp), modifier = Modifier.padding(16.dp),
action = { action = {
Button( buttonComponent("OK", { noFileSnackbarVisibleState.value = false })
onClick = { noFileSnackbarVisibleState.value = false },
colors = ButtonDefaults.buttonColors(
backgroundColor = customRedColor,
contentColor = Color.White
)
) {
Text("OK")
}
} }
) { ) {
Text("Veuillez d'abord importer un fichier") Text("Veuillez d'abord importer un fichier")
@ -211,20 +203,7 @@ fun glossaryList(glossaries: List<Glossary>, onGlossarySelected: (Glossary) -> U
modifier = Modifier.width(200.dp).fillMaxWidth(), modifier = Modifier.width(200.dp).fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween horizontalArrangement = Arrangement.SpaceBetween
) { ) {
Button( buttonComponent(glossary.name, { onGlossarySelected(glossary) })
onClick = {
onGlossarySelected(glossary)
},
modifier = Modifier
.width(150.dp)
.padding(10.dp, 0.dp, 0.dp, 0.dp),
colors = ButtonDefaults.buttonColors(
backgroundColor = customRedColor,
contentColor = Color.White
)
) {
Text(glossary.name)
}
} }
} }
} }
@ -237,15 +216,7 @@ fun glossaryList(glossaries: List<Glossary>, onGlossarySelected: (Glossary) -> U
} }
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
Button( buttonComponent("Retour", onBackClick)
onClick = onBackClick,
colors = ButtonDefaults.buttonColors(
backgroundColor = customRedColor,
contentColor = Color.White
)
) {
Text("Retour")
}
} }
} }
@ -286,20 +257,7 @@ fun projectList(projects: List<Project>, onProjectSelected: (Project) -> Unit, o
modifier = Modifier.width(200.dp).fillMaxWidth(), modifier = Modifier.width(200.dp).fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween horizontalArrangement = Arrangement.SpaceBetween
) { ) {
Button( buttonComponent(project.name, { onProjectSelected(project) })
onClick = {
onProjectSelected(project)
},
modifier = Modifier
.width(150.dp)
.padding(10.dp, 0.dp, 0.dp, 0.dp),
colors = ButtonDefaults.buttonColors(
backgroundColor = customRedColor,
contentColor = Color.White
)
) {
Text(project.name)
}
} }
} }
} }
@ -312,15 +270,6 @@ fun projectList(projects: List<Project>, onProjectSelected: (Project) -> Unit, o
} }
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
Button( buttonComponent("Retour", onBackClick)
onClick = onBackClick,
colors = ButtonDefaults.buttonColors(
backgroundColor = customRedColor,
contentColor = Color.White
)
) {
Text("Retour")
}
} }
} }