-
Notifications
You must be signed in to change notification settings - Fork 9
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-3213] Address Details #1100
Conversation
@@ -31,6 +31,21 @@ extension Gradient { | |||
] | |||
} | |||
|
|||
extension LinearGradient.App { | |||
public var brand1: LinearGradient { |
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.
Ended up not being used on these designs but decided to keep it as we will probably need it somewhere else (it is part of the design system.
RadixWallet/Core/FeaturePrelude/AddressView/AddressDetails+View.swift
Outdated
Show resolved
Hide resolved
RadixWallet/Core/FeaturePrelude/AddressView/AddressDetails.swift
Outdated
Show resolved
Hide resolved
RadixWallet/Core/FeaturePrelude/AddressView/AddressDetails+View.swift
Outdated
Show resolved
Hide resolved
} | ||
|
||
private extension AddressDetails.ViewState { | ||
static func colorised(address: LedgerIdentifiable.Address) -> AttributedString { |
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.
I think this should be either a local private function, or, if you might want to use it somewhere else, a var
on LedgerIdentifiable.Address
or something.
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.
The idea was to computate it only once
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.
The ViewState is actually re-computed every time anything changes, as is the entire SwiftUI View, so I don't think it makes any difference.
But either way, my idea was just to change the ergonomics to something like this:
let addressString = address.colorizedString
It might be that Observable is smart enough to only recompute it when the underlying address changes if you do it like that. When it's in the ViewState, any change to any property on the ViewState would recompute everything.
Seems like it could be useful more generally, btw.
RadixWallet/Core/FeaturePrelude/AddressView/AddressDetails.swift
Outdated
Show resolved
Hide resolved
RadixWallet/Core/FeaturePrelude/AddressView/AddressDetails.swift
Outdated
Show resolved
Hide resolved
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.
Looks good, just some minor suggestions
RadixWallet/Core/FeaturePrelude/AddressView/AddressDetails+View.swift
Outdated
Show resolved
Hide resolved
RadixWallet/Core/FeaturePrelude/AddressView/AddressDetails+View.swift
Outdated
Show resolved
Hide resolved
RadixWallet/Core/FeaturePrelude/AddressView/AddressDetails+View.swift
Outdated
Show resolved
Hide resolved
RadixWallet/Core/FeaturePrelude/AddressView/AddressDetails.swift
Outdated
Show resolved
Hide resolved
@@ -1,18 +1,21 @@ | |||
// MARK: - AddressDetails | |||
public struct AddressDetails: Sendable, FeatureReducer { |
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 add @Reducer
to this. Then you need to also put public typealias Action = FeatureAction<Self>
explicitly, otherwise the compiler gets confused.
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 what's the benefit of doing so if we still need to implement every func reduce
we currently have?
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.
It's usually good to stay up to date with the latest generation of TCA, so we can enjoy any future improvements coming to @Reducer
they make.
Now the dismiss doesn't actually work for me in your PR. But putting |
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.
LGTM!
.presentationDetents([.large]) | ||
.presentationDragIndicator(.visible) | ||
.task { | ||
store.send(.view(.task)) |
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 this rather be:
await store.send(.view(.task)).finish()
to allow proper cancellation
Jira ticket: ABW-3213
Jira ticket: ABW-3256
Description
This PR adds a sheet presented every time the user taps on an
AddressView
with aLedgerIdentifiable.Address
associated.Video
demo.mov