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

Address Details + NFT Name UI fixes #1201

Merged
merged 4 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,13 @@ public extension AddressDetails {
Group {
switch store.qrImage {
case let .success(value):
Image(decorative: value, scale: 1)
.resizable()
.aspectRatio(1, contentMode: .fit)
.transition(.scale(scale: 0.95).combined(with: .opacity))
GeometryReader { proxy in
Image(decorative: value, scale: 1)
.resizable()
.frame(width: proxy.size.height, height: proxy.size.height)
.frame(maxWidth: .infinity)
.transition(.scale(scale: 0.95).combined(with: .opacity))
}
case .failure:
Text(L10n.AddressDetails.qrCodeFailure)
.textStyle(.body1HighImportance)
Expand Down Expand Up @@ -220,15 +223,6 @@ private extension AddressDetails.View {
}

private extension AddressDetails.State {
var showQrCode: Bool {
switch address {
case .account:
true
default:
false
}
}

var showVerifyOnLedger: Bool {
switch address {
case let .account(_, isLedgerHWAccount):
Expand Down
14 changes: 14 additions & 0 deletions RadixWallet/Core/FeaturePrelude/AddressView/AddressDetails.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ public struct AddressDetails: Sendable, FeatureReducer {
}

private func loadQrCodeEffect(state: inout State) -> Effect<Action> {
guard state.showQrCode else {
return .none
}
state.qrImage = .loading
let content = QR.addressPrefix + state.address.address
return .run { send in
Expand All @@ -142,6 +145,17 @@ public struct AddressDetails: Sendable, FeatureReducer {

// MARK: - Helpers

extension AddressDetails.State {
var showQrCode: Bool {
switch address {
case .account:
true
default:
false
}
}
}

private extension OnLedgerEntity.Resource {
var resourceTitle: String? {
guard let name = metadata.name else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extension NonFungibleTokenDetails.State {
resourceAddress: resourceAddress,
isXRD: false,
validatorAddress: nil,
resourceName: resourceDetails.metadata.title,
resourceName: resourceDetails.metadata.name,
currentSupply: resourceDetails.totalSupply.map { $0?.formatted() },
arbitraryDataFields: resourceDetails.metadata.arbitraryItems.asDataFields,
behaviors: resourceDetails.behaviors,
Expand Down
Loading