Use buttonComponent on Home.kt
parent
34656cfac3
commit
5a943d4d9f
|
@ -90,15 +90,7 @@ fun homePage(
|
|||
Snackbar(
|
||||
modifier = Modifier.padding(16.dp),
|
||||
action = {
|
||||
Button(
|
||||
onClick = { noFileSnackbarVisibleState.value = false },
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
backgroundColor = customRedColor,
|
||||
contentColor = Color.White
|
||||
)
|
||||
) {
|
||||
Text("OK")
|
||||
}
|
||||
buttonComponent("OK", { noFileSnackbarVisibleState.value = false })
|
||||
}
|
||||
) {
|
||||
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(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween
|
||||
) {
|
||||
Button(
|
||||
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)
|
||||
}
|
||||
buttonComponent(glossary.name, { onGlossarySelected(glossary) })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -237,15 +216,7 @@ fun glossaryList(glossaries: List<Glossary>, onGlossarySelected: (Glossary) -> U
|
|||
}
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Button(
|
||||
onClick = onBackClick,
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
backgroundColor = customRedColor,
|
||||
contentColor = Color.White
|
||||
)
|
||||
) {
|
||||
Text("Retour")
|
||||
}
|
||||
buttonComponent("Retour", onBackClick)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -286,20 +257,7 @@ fun projectList(projects: List<Project>, onProjectSelected: (Project) -> Unit, o
|
|||
modifier = Modifier.width(200.dp).fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween
|
||||
) {
|
||||
Button(
|
||||
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)
|
||||
}
|
||||
buttonComponent(project.name, { onProjectSelected(project) })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -312,15 +270,6 @@ fun projectList(projects: List<Project>, onProjectSelected: (Project) -> Unit, o
|
|||
}
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Button(
|
||||
onClick = onBackClick,
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
backgroundColor = customRedColor,
|
||||
contentColor = Color.White
|
||||
)
|
||||
) {
|
||||
Text("Retour")
|
||||
}
|
||||
|
||||
buttonComponent("Retour", onBackClick)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue