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

Add warning message in Export to CSV button in SettingsScreen #2656

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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