Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Add warning message in Export to CSV button in SettingsScreen (#2656)
Browse files Browse the repository at this point in the history
Co-authored-by: ILIYANGERMANOV <[email protected]>
  • Loading branch information
nicolegeorgieva and ILIYANGERMANOV authored Sep 20, 2023
1 parent de56dee commit 78c140a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions screen-settings/src/main/java/com/ivy/settings/SettingsScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,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()
}
Expand Down Expand Up @@ -869,7 +870,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(
Expand Down Expand Up @@ -900,7 +901,7 @@ private fun SettingsPrimaryButton(
fontWeight = FontWeight.Bold,
)
)
if (description.isNotEmpty()) {
if (!description.isNullOrEmpty()) {
Text(
modifier = Modifier.padding(end = 8.dp),
text = description,
Expand Down Expand Up @@ -1086,14 +1087,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()
}
Expand Down

0 comments on commit 78c140a

Please sign in to comment.