-
Notifications
You must be signed in to change notification settings - Fork 7
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
[ABW-3960] - Factor source card component #1268
[ABW-3960] - Factor source card component #1268
Conversation
@Suppress("LongMethod") | ||
override fun initialState(): State = State( | ||
displayOnlyItems = persistentListOf( | ||
newLedgerHardwareWalletFactorSourceSample().toCard( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used the Sargon global functions here to prevent cascading the @UsesSampleValues annotation throughout all the related components. I hope this is acceptable because this code is not meant to be used in production as it only serves as an example until we implement the actual feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also use @Opt-In(UsesSampleValues::class)
and use the samples defined too. Perfectly acceptable in such view model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice expand/collapse animations!
data class Instance( | ||
val id: FactorSourceId.Hash, | ||
val name: String, | ||
val lastUsedOn: String? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be a string or a Sargon timestamp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the formatted time based on a Sargon Timestamp. It's a matter of deciding if we want to format it in the ViewModel or directly in the UI, now I'm formatting it in the ViewModel and let the UI display it as it is.
@@ -0,0 +1,27 @@ | |||
package com.babylon.wallet.android.domain.model.factors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should such model be kept in a ui.model
package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And maybe start putting such models in that package now that we use them more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point
@Suppress("LongMethod") | ||
override fun initialState(): State = State( | ||
displayOnlyItems = persistentListOf( | ||
newLedgerHardwareWalletFactorSourceSample().toCard( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also use @Opt-In(UsesSampleValues::class)
and use the samples defined too. Perfectly acceptable in such view model.
Quality Gate failedFailed conditions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beautiful 💅🏽
ABW-3960
Description
Adds reusable and configurable factor source card component.
Video
Recorder_04122024_113702.mp4