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

Commit

Permalink
fix-issue-3488
Browse files Browse the repository at this point in the history
  • Loading branch information
shamim-emon committed Sep 12, 2024
1 parent 256a9a8 commit 5382191
Showing 1 changed file with 86 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,12 @@ private fun PreviewCategoriesCompactModeEnabled(theme: Theme = Theme.LIGHT) {
Preview(theme = theme, compactModeEnabled = true)
}

@Preview
@Composable
private fun PreviewCategoriesCompactModeEnabledAndSearchBarEnabled(theme: Theme = Theme.LIGHT) {
Preview(theme = theme, compactModeEnabled = true, displaySearchBarEnabled = true)
}

@Preview
@Composable
private fun Preview(
Expand Down Expand Up @@ -766,6 +772,86 @@ private fun Preview(
}
}

@Preview
@Composable
private fun PreviewWithSearchBarEnabled(
theme: Theme = Theme.LIGHT,
compactModeEnabled: Boolean = false,
displaySearchBarEnabled: Boolean = true
) {
com.ivy.legacy.IvyWalletPreview(theme) {
val state = CategoriesScreenState(
baseCurrency = "BGN",
compactCategoriesModeEnabled = compactModeEnabled,
showCategorySearchBar = displaySearchBarEnabled,
categories = persistentListOf(
CategoryData(
category = Category(
id = CategoryId(UUID.randomUUID()),
name = NotBlankTrimmedString.unsafe("Groceries"),
color = ColorInt(Green.toArgb()),
icon = IconAsset.unsafe("groceries"),
orderNum = 0.0,
),
monthlyBalance = 2125.0,
monthlyExpenses = 920.0,
monthlyIncome = 3045.0
),
CategoryData(
category = Category(
id = CategoryId(UUID.randomUUID()),
name = NotBlankTrimmedString.unsafe("Fun"),
color = ColorInt(Orange.toArgb()),
icon = IconAsset.unsafe("game"),
orderNum = 0.0,
),
monthlyBalance = 1200.0,
monthlyExpenses = 750.0,
monthlyIncome = 0.0
),
CategoryData(
category = Category(
id = CategoryId(UUID.randomUUID()),
name = NotBlankTrimmedString.unsafe("Ivy"),
color = ColorInt(IvyDark.toArgb()),
icon = IconAsset.unsafe("star"),
orderNum = 0.0,
),
monthlyBalance = 1200.0,
monthlyExpenses = 0.0,
monthlyIncome = 5000.0
),
CategoryData(
category = Category(
id = CategoryId(UUID.randomUUID()),
name = NotBlankTrimmedString.unsafe("Food"),
color = ColorInt(GreenLight.toArgb()),
icon = IconAsset.unsafe("atom"),
orderNum = 0.0,
),
monthlyBalance = 12125.21,
monthlyExpenses = 1350.50,
monthlyIncome = 8000.48
),
CategoryData(
category = Category(
id = CategoryId(UUID.randomUUID()),
name = NotBlankTrimmedString.unsafe("Shisha"),
color = ColorInt(GreenDark.toArgb()),
icon = IconAsset.unsafe("drink"),
orderNum = 0.0,
),
monthlyBalance = 820.0,
monthlyExpenses = 340.0,
monthlyIncome = 400.0
),

)
)
UI(state = state)
}
}

@Composable
private fun SearchField(
onSearch: (String) -> Unit,
Expand Down

0 comments on commit 5382191

Please sign in to comment.