@@ -23,6 +23,7 @@ import androidx.compose.material3.TextButton
2323import androidx.compose.runtime.Composable
2424import androidx.compose.ui.Alignment
2525import androidx.compose.ui.Modifier
26+ import androidx.compose.ui.graphics.Color
2627import androidx.compose.ui.tooling.preview.Preview
2728import androidx.compose.ui.unit.dp
2829import io.github.sds100.keymapper.base.compose.KeyMapperTheme
@@ -34,12 +35,13 @@ fun TipCard(
3435 message : String ,
3536 buttonText : String? = null,
3637 isDismissable : Boolean = true,
38+ color : Color = MaterialTheme .colorScheme.tertiary,
3739 onDismiss : () -> Unit = {},
3840 onButtonClick : () -> Unit = {},
3941) {
4042 OutlinedCard (
4143 modifier = modifier,
42- border = BorderStroke (1 .dp, MaterialTheme .colorScheme.tertiary ),
44+ border = BorderStroke (1 .dp, color ),
4345 elevation = CardDefaults .elevatedCardElevation(),
4446 ) {
4547 Box (
@@ -54,7 +56,7 @@ fun TipCard(
5456 Icon (
5557 imageVector = Icons .Rounded .Info ,
5658 contentDescription = null ,
57- tint = MaterialTheme .colorScheme.tertiary ,
59+ tint = color ,
5860 )
5961
6062 Spacer (modifier = Modifier .width(8 .dp))
@@ -74,6 +76,8 @@ fun TipCard(
7476 style = MaterialTheme .typography.bodyMedium,
7577 )
7678
79+ Spacer (modifier = Modifier .height(4 .dp))
80+
7781 if (buttonText != null ) {
7882 Spacer (modifier = Modifier .height(8 .dp))
7983
@@ -82,7 +86,7 @@ fun TipCard(
8286 .padding(horizontal = 16 .dp)
8387 .align(Alignment .End ),
8488 onClick = onButtonClick,
85- colors = ButtonDefaults .textButtonColors(contentColor = MaterialTheme .colorScheme.tertiary )
89+ colors = ButtonDefaults .textButtonColors(contentColor = color )
8690 ) {
8791 Text (buttonText)
8892 }
@@ -104,8 +108,8 @@ fun TipCard(
104108 tint = MaterialTheme .colorScheme.onSurfaceVariant,
105109 )
106110 }
107- }
108111 }
112+ }
109113 }
110114}
111115
0 commit comments