@@ -686,6 +686,12 @@ private fun PreviewCategoriesCompactModeEnabled(theme: Theme = Theme.LIGHT) {
686
686
Preview (theme = theme, compactModeEnabled = true )
687
687
}
688
688
689
+ @Preview
690
+ @Composable
691
+ private fun PreviewCategoriesCompactModeEnabledAndSearchBarEnabled (theme : Theme = Theme .LIGHT ) {
692
+ Preview (theme = theme, compactModeEnabled = true , displaySearchBarEnabled = true )
693
+ }
694
+
689
695
@Preview
690
696
@Composable
691
697
private fun Preview (
@@ -766,6 +772,86 @@ private fun Preview(
766
772
}
767
773
}
768
774
775
+ @Preview
776
+ @Composable
777
+ private fun PreviewWithSearchBarEnabled (
778
+ theme : Theme = Theme .LIGHT ,
779
+ compactModeEnabled : Boolean = false,
780
+ displaySearchBarEnabled : Boolean = true
781
+ ) {
782
+ com.ivy.legacy.IvyWalletPreview (theme) {
783
+ val state = CategoriesScreenState (
784
+ baseCurrency = " BGN" ,
785
+ compactCategoriesModeEnabled = compactModeEnabled,
786
+ showCategorySearchBar = displaySearchBarEnabled,
787
+ categories = persistentListOf(
788
+ CategoryData (
789
+ category = Category (
790
+ id = CategoryId (UUID .randomUUID()),
791
+ name = NotBlankTrimmedString .unsafe(" Groceries" ),
792
+ color = ColorInt (Green .toArgb()),
793
+ icon = IconAsset .unsafe(" groceries" ),
794
+ orderNum = 0.0 ,
795
+ ),
796
+ monthlyBalance = 2125.0 ,
797
+ monthlyExpenses = 920.0 ,
798
+ monthlyIncome = 3045.0
799
+ ),
800
+ CategoryData (
801
+ category = Category (
802
+ id = CategoryId (UUID .randomUUID()),
803
+ name = NotBlankTrimmedString .unsafe(" Fun" ),
804
+ color = ColorInt (Orange .toArgb()),
805
+ icon = IconAsset .unsafe(" game" ),
806
+ orderNum = 0.0 ,
807
+ ),
808
+ monthlyBalance = 1200.0 ,
809
+ monthlyExpenses = 750.0 ,
810
+ monthlyIncome = 0.0
811
+ ),
812
+ CategoryData (
813
+ category = Category (
814
+ id = CategoryId (UUID .randomUUID()),
815
+ name = NotBlankTrimmedString .unsafe(" Ivy" ),
816
+ color = ColorInt (IvyDark .toArgb()),
817
+ icon = IconAsset .unsafe(" star" ),
818
+ orderNum = 0.0 ,
819
+ ),
820
+ monthlyBalance = 1200.0 ,
821
+ monthlyExpenses = 0.0 ,
822
+ monthlyIncome = 5000.0
823
+ ),
824
+ CategoryData (
825
+ category = Category (
826
+ id = CategoryId (UUID .randomUUID()),
827
+ name = NotBlankTrimmedString .unsafe(" Food" ),
828
+ color = ColorInt (GreenLight .toArgb()),
829
+ icon = IconAsset .unsafe(" atom" ),
830
+ orderNum = 0.0 ,
831
+ ),
832
+ monthlyBalance = 12125.21 ,
833
+ monthlyExpenses = 1350.50 ,
834
+ monthlyIncome = 8000.48
835
+ ),
836
+ CategoryData (
837
+ category = Category (
838
+ id = CategoryId (UUID .randomUUID()),
839
+ name = NotBlankTrimmedString .unsafe(" Shisha" ),
840
+ color = ColorInt (GreenDark .toArgb()),
841
+ icon = IconAsset .unsafe(" drink" ),
842
+ orderNum = 0.0 ,
843
+ ),
844
+ monthlyBalance = 820.0 ,
845
+ monthlyExpenses = 340.0 ,
846
+ monthlyIncome = 400.0
847
+ ),
848
+
849
+ )
850
+ )
851
+ UI (state = state)
852
+ }
853
+ }
854
+
769
855
@Composable
770
856
private fun SearchField (
771
857
onSearch : (String ) -> Unit ,
0 commit comments