Skip to content

Commit

Permalink
refactor out card routine
Browse files Browse the repository at this point in the history
  • Loading branch information
vextorspace committed May 29, 2024
1 parent 2e24b67 commit 134a399
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions composeApp/src/commonMain/kotlin/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@ fun App() {
Modifier.fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally
) {
Card(modifier = Modifier.padding(6.dp),
elevation = 3.dp) {
Column {
Text(text = "Create a card",
style = MaterialTheme.typography.h5)
Text("- create card body")
}
}
makeCard("Create a card", "- create card body")
}
}
}

private fun makeCard(title: String, content: String) {
Card(
modifier = Modifier.padding(6.dp),
elevation = 3.dp
) {
Column {
Text(
text = title,
style = MaterialTheme.typography.h5
)
Text(content)
}
}
}

0 comments on commit 134a399

Please sign in to comment.