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

Commit

Permalink
AccountTab: Show/Hide Account Functionality Added - added missing pro…
Browse files Browse the repository at this point in the history
…perty in test + detekt issues fixed
  • Loading branch information
shamim-emon committed Nov 4, 2024
1 parent a44df3d commit 0c5caee
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ private fun Preview() {
IvyWalletComponentPreview {
Suggestions(
suggestions = listOf(
Account("Cash", isVisible = true, color = Green.toArgb()),
Account("Bank", isVisible = true, color = Red.toArgb()),
Account("Revolut", isVisible = true, color = Purple.toArgb())
Account("Cash", isVisible = true, color = Green.toArgb()),
Account("Bank", isVisible = true, color = Red.toArgb()),
Account("Revolut", isVisible = true, color = Purple.toArgb())
),
onAddSuggestion = { }
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ private fun Preview() {
currency = "BGN",
description = null,
category = null,
account = Account(name = "phyre", isVisible = true, color = Orange.toArgb()),
account = Account(name = "phyre", isVisible = true, color = Orange.toArgb()),
amount = 0.0,
transactionType = TransactionType.INCOME,
categories = persistentListOf(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private fun BoxWithConstraintsScope.UI(
@Composable
private fun Preview() {
IvyWalletPreview {
val account = Account(name = "Cash", isVisible = true, color = Green.toArgb())
val account = Account(name = "Cash", isVisible = true, color = Green.toArgb())
val food = Category(
name = NotBlankTrimmedString.unsafe("Food"),
color = ColorInt(Purple.toArgb()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ fun Arb.Companion.account(
icon = Arb.maybe(Arb.iconAsset()).bind(),
includeInBalance = includeInBalance.getOrElse { Arb.boolean().bind() },
orderNum = orderNum.getOrElse { Arb.double().bind() },
isVisible = true
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.ivy.wallet.domain.deprecated.logic.model

import androidx.compose.ui.graphics.Color

@Suppress("DataClassDefaultValues")
data class CreateAccountData(
val name: String,
val currency: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ private fun Preview() {
acc1,
Account("DSK", isVisible = true, color = GreenDark.toArgb()),
Account("phyre", isVisible = true, color = GreenLight.toArgb()),
Account("Revolut" ,isVisible = true, color = IvyDark.toArgb()),
Account("Revolut", isVisible = true, color = IvyDark.toArgb()),
),
selectedAccount = acc1,
toAccount = null,
Expand All @@ -833,8 +833,8 @@ private fun Preview() {
@Composable
private fun Preview_Transfer() {
IvyWalletPreview {
val acc1 = Account("Cash", isVisible = true, color = Green.toArgb())
val acc2 = Account("DSK", isVisible = true, color = GreenDark.toArgb())
val acc1 = Account("Cash", isVisible = true, color = Green.toArgb())
val acc2 = Account("DSK", isVisible = true, color = GreenDark.toArgb())

BoxWithConstraints(
modifier = Modifier
Expand All @@ -852,8 +852,8 @@ private fun Preview_Transfer() {
accounts = listOf(
acc1,
acc2,
Account("phyre", isVisible = true, color = GreenLight.toArgb(), icon = "cash"),
Account("Revolut", isVisible = true, color = IvyDark.toArgb()),
Account("phyre", isVisible = true, color = GreenLight.toArgb(), icon = "cash"),
Account("Revolut", isVisible = true, color = IvyDark.toArgb()),
),
selectedAccount = acc1,
toAccount = acc2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ private data class AmountTypeStyle(
private fun PreviewUpcomingExpense() {
IvyWalletPreview {
LazyColumn(Modifier.fillMaxSize()) {
val cash = Account(name = "Cash", isVisible = true, color = Green.toArgb())
val cash = Account(name = "Cash", isVisible = true, color = Green.toArgb())
val food = Category(
name = NotBlankTrimmedString.unsafe("Food"),
color = ColorInt(Blue.toArgb()),
Expand Down Expand Up @@ -695,7 +695,7 @@ private fun PreviewUpcomingExpense() {
private fun PreviewUpcomingExpenseBadgeSecondRow() {
IvyWalletPreview {
LazyColumn(Modifier.fillMaxSize()) {
val cash = Account(name = "Cash", isVisible = true, color = Green.toArgb())
val cash = Account(name = "Cash", isVisible = true, color = Green.toArgb())
val food = Category(
name = NotBlankTrimmedString.unsafe("Food-Travel-Entertaiment-Food"),
color = ColorInt(Blue.toArgb()),
Expand Down Expand Up @@ -734,7 +734,7 @@ private fun PreviewUpcomingExpenseBadgeSecondRow() {
private fun PreviewOverdueExpense() {
IvyWalletPreview {
LazyColumn(Modifier.fillMaxSize()) {
val cash = Account(name = "Cash", isVisible = true, color = Green.toArgb())
val cash = Account(name = "Cash", isVisible = true, color = Green.toArgb())
val food = Category(
name = NotBlankTrimmedString.unsafe("Rent"),
color = ColorInt(Green.toArgb()),
Expand Down Expand Up @@ -773,7 +773,7 @@ private fun PreviewOverdueExpense() {
private fun PreviewNormalExpense() {
IvyWalletPreview {
LazyColumn(Modifier.fillMaxSize()) {
val cash = Account(name = "Cash", isVisible = true, color = Green.toArgb())
val cash = Account(name = "Cash", isVisible = true, color = Green.toArgb())
val food = Category(
name = NotBlankTrimmedString.unsafe("Bitovi"),
color = ColorInt(Orange.toArgb()),
Expand Down Expand Up @@ -811,7 +811,7 @@ private fun PreviewNormalExpense() {
private fun PreviewIncome() {
IvyWalletPreview {
LazyColumn(Modifier.fillMaxSize()) {
val cash = Account(name = "DSK Bank", isVisible = true, color = Green.toArgb())
val cash = Account(name = "DSK Bank", isVisible = true, color = Green.toArgb())
val category = Category(
name = NotBlankTrimmedString.unsafe("Salary"),
color = ColorInt(GreenDark.toArgb()),
Expand Down Expand Up @@ -849,8 +849,14 @@ private fun PreviewIncome() {
private fun PreviewTransfer() {
IvyWalletPreview {
LazyColumn(Modifier.fillMaxSize()) {
val acc1 = Account(name = "DSK Bank", color = Green.toArgb(), isVisible = true, icon = "bank")
val acc2 = Account(name = "Revolut", color = IvyDark.toArgb(), isVisible = true, icon = "revolut")
val acc1 =
Account(name = "DSK Bank", color = Green.toArgb(), isVisible = true, icon = "bank")
val acc2 = Account(
name = "Revolut",
color = IvyDark.toArgb(),
isVisible = true,
icon = "revolut"
)

item {
TransactionCard(
Expand Down Expand Up @@ -881,7 +887,8 @@ private fun PreviewTransfer() {
private fun PreviewTransfer_differentCurrency() {
IvyWalletPreview {
LazyColumn(Modifier.fillMaxSize()) {
val acc1 = Account(name = "DSK Bank", color = Green.toArgb(), isVisible = true, icon = "bank")
val acc1 =
Account(name = "DSK Bank", color = Green.toArgb(), isVisible = true, icon = "bank")
val acc2 = Account(
name = "Revolut",
currency = "EUR",
Expand Down

0 comments on commit 0c5caee

Please sign in to comment.