Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/colored asset icons fix #1704

Merged
merged 13 commits into from
Nov 1, 2024

Conversation

antonijzelinskij
Copy link
Contributor

@antonijzelinskij antonijzelinskij commented Oct 30, 2024

#86966j47d

@antonijzelinskij antonijzelinskij changed the base branch from develop to feature/portfolio-view-flows October 30, 2024 12:44
Comment on lines 13 to 15
fun getAssetIcon(iconName: String?, fallback: Icon = fallbackIcon): Icon

fun getWhiteAssetIcon(iconName: String?, fallback: Icon = fallbackIcon): Icon
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave a few suggestions for the interface here:

  1. The idea of having fallback icon being exposed by AssetIconProvider looks good. However I think we can make the the interface clearer if getAssetIcon wont allow for nullable iconName. Instead, we can create an extension function that allows nullability and has the same signature that is currently present in the interface directly. This way we will simplify the interface itself
  2. Instead of creating a separate instance of getWhiteAssetIcon how about we make a function getAssetIcon(iconName, iconType) and implementgetWhiteAssetIcon in a form of extension? This way you wont need to icon formatting logic twice since getAssetIcon(iconName) can easily delegate its work to getAssetIcon(iconName, iconType) by passing iconType=selectedIconType

@@ -18,13 +18,13 @@ class AssetsListInteractor(
private val accountRepository: AccountRepository,
private val nftRepository: NftRepository,
private val bannerVisibilityRepository: BannerVisibilityRepository,
private val assetsViewModeRepository: AssetsViewModeRepository
private val assetsViewModeService: AssetsViewModeRepository
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change it back to assetsViewModeRepository to much the class name

Comment on lines 68 to 70
val currentChains = chainDao.joinChainInfoFlow().map { chains ->
chains.map { mapChainLocalToChain(it, gson) }
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can revert it back to mapList

Base automatically changed from feature/portfolio-view-flows to portfolio-view-base November 1, 2024 08:35

fun getAssetIcon(iconName: String?, fallback: Icon = fallbackIcon): Icon
fun getAssetIconOrFallback(iconName: String): Icon
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why there is orFallback in the name?

@antonijzelinskij antonijzelinskij merged commit 5c3841f into portfolio-view-base Nov 1, 2024
3 checks passed
@antonijzelinskij antonijzelinskij deleted the feature/colored-asset-icons-fix branch November 1, 2024 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants