Add warning message to InputLayout

This commit is contained in:
Wolf-Martell Montwé 2023-09-27 16:14:47 +02:00 committed by cketti
parent 955724b320
commit 761f8b51bc

View file

@ -15,6 +15,7 @@ internal fun InputLayout(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
contentPadding: PaddingValues = inputContentPadding(), contentPadding: PaddingValues = inputContentPadding(),
errorMessage: String? = null, errorMessage: String? = null,
warningMessage: String? = null,
content: @Composable () -> Unit, content: @Composable () -> Unit,
) { ) {
Column( Column(
@ -32,5 +33,13 @@ internal fun InputLayout(
color = MainTheme.colors.error, color = MainTheme.colors.error,
) )
} }
AnimatedVisibility(visible = warningMessage != null) {
TextCaption(
text = warningMessage ?: "",
modifier = Modifier.padding(start = MainTheme.spacings.double, top = MainTheme.spacings.half),
color = MainTheme.colors.warning,
)
}
} }
} }