From 23b54ffeba9c16aec325ed2ad1c67e86ba536fc1 Mon Sep 17 00:00:00 2001 From: Nicole Date: Wed, 20 Sep 2023 17:34:50 +0300 Subject: [PATCH] Add warning message in Export to CSV button in SettingsScreen --- .../main/java/com/ivy/settings/SettingsScreen.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/screen-settings/src/main/java/com/ivy/settings/SettingsScreen.kt b/screen-settings/src/main/java/com/ivy/settings/SettingsScreen.kt index c964327937..3dc9cf0ce2 100644 --- a/screen-settings/src/main/java/com/ivy/settings/SettingsScreen.kt +++ b/screen-settings/src/main/java/com/ivy/settings/SettingsScreen.kt @@ -803,7 +803,8 @@ private fun ExportCSV( SettingsDefaultButton( icon = R.drawable.ic_vue_pc_printer, text = stringResource(R.string.export_to_csv), - iconPadding = 6.dp + iconPadding = 6.dp, + description = "⚠\uFE0F Do not use for backup purposes" ) { onExportToCSV() } @@ -868,7 +869,7 @@ private fun SettingsPrimaryButton( backgroundGradient: Gradient = Gradient.solid(UI.colors.medium), textColor: Color = White, iconPadding: Dp = 0.dp, - description: String = "", + description: String? = null, onClick: () -> Unit ) { SettingsButtonRow( @@ -899,7 +900,7 @@ private fun SettingsPrimaryButton( fontWeight = FontWeight.Bold, ) ) - if (description.isNotEmpty()) { + if (!description.isNullOrEmpty()) { Text( modifier = Modifier.padding(end = 8.dp), text = description, @@ -1085,14 +1086,16 @@ private fun SettingsDefaultButton( @DrawableRes icon: Int, text: String, iconPadding: Dp = 0.dp, - onClick: () -> Unit + description: String? = null, + onClick: () -> Unit, ) { SettingsPrimaryButton( icon = icon, text = text, backgroundGradient = Gradient.solid(UI.colors.medium), textColor = UI.colors.pureInverse, - iconPadding = iconPadding + iconPadding = iconPadding, + description = description ) { onClick() }