From f234a2e0e567bf1d963aa95846e575427b60fc21 Mon Sep 17 00:00:00 2001 From: Yasan Ghaffarian Date: Sun, 10 Mar 2024 02:58:28 +0100 Subject: [PATCH] Create TextWithTextButton --- .../component/group/TextWithTextButton.kt | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 concrete/src/main/kotlin/glass/yasan/concrete/component/group/TextWithTextButton.kt diff --git a/concrete/src/main/kotlin/glass/yasan/concrete/component/group/TextWithTextButton.kt b/concrete/src/main/kotlin/glass/yasan/concrete/component/group/TextWithTextButton.kt new file mode 100644 index 0000000..705bc01 --- /dev/null +++ b/concrete/src/main/kotlin/glass/yasan/concrete/component/group/TextWithTextButton.kt @@ -0,0 +1,41 @@ +package glass.yasan.concrete.component.group + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.vector.ImageVector +import glass.yasan.concrete.component.ButtonText +import glass.yasan.concrete.component.Spacer +import glass.yasan.concrete.component.Text +import glass.yasan.spine.compose.foundation.grid + +@Composable +public fun TextWithTextButton( + text: String, + buttonText: String, + onClick: () -> Unit, + modifier: Modifier = Modifier, + buttonModifier: Modifier = Modifier, + buttonStartIcon: ImageVector? = null, + buttonEndIcon: ImageVector? = null +) { + Column( + modifier = modifier + .fillMaxWidth(), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Spacer(height = 2.grid) + Text(text = text) + Spacer(height = 2.grid) + ButtonText( + text = buttonText, + startIcon = buttonStartIcon, + endIcon = buttonEndIcon, + onClick = onClick, + modifier = buttonModifier, + ) + Spacer(height = 2.grid) + } +}