diff --git a/src/main/kotlin/main/Home.kt b/src/main/kotlin/main/Home.kt index 7847817..8928e1a 100644 --- a/src/main/kotlin/main/Home.kt +++ b/src/main/kotlin/main/Home.kt @@ -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, 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, 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, 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, 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) } }