Skip to content

Commit

Permalink
[ABW-3649] Improve the address details actions to support increased f…
Browse files Browse the repository at this point in the history
…ont size (#1238)
  • Loading branch information
danvleju-rdx authored Jul 26, 2024
1 parent 38d5e98 commit 3e66941
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,33 @@ public extension AddressDetails {
.animation(.easeInOut, value: store.qrImage.isSuccess)
}

@ViewBuilder
private var actions: some SwiftUI.View {
HStack(spacing: .large3) {
Button(L10n.AddressDetails.copy, image: .copy) {
FlowLayout(multilineAlignment: .center, spacing: .large3) {
actionButton(L10n.AddressDetails.copy, image: .copyBig) {
store.send(.view(.copyButtonTapped))
}
Button(L10n.AddressDetails.enlarge, image: .fullScreen) {
actionButton(L10n.AddressDetails.enlarge, image: .fullScreen) {
store.send(.view(.enlargeButtonTapped))
}
Button(L10n.AddressDetails.share, systemImage: "square.and.arrow.up") {
actionButton(L10n.AddressDetails.share, image: .share) {
store.send(.view(.shareButtonTapped))
}
}
.padding(.horizontal, .medium2)
.foregroundColor(.app.gray1)
}

private func actionButton(_ title: String, image: ImageResource, action: @escaping () -> Void) -> some SwiftUI.View {
Button(action: action) {
HStack(spacing: .small3) {
Image(image)
.renderingMode(.template)
.resizable()
.frame(.icon)
.foregroundColor(.app.gray2)
Text(title)
.foregroundColor(.app.gray1)
}
}
}

private var bottom: some SwiftUI.View {
Expand Down Expand Up @@ -139,6 +152,7 @@ private extension AddressDetails.View {
Text(L10n.AddressDetails.fullAddress)
.foregroundColor(.app.gray1)
Text(colorisedText)
.fixedSize(horizontal: false, vertical: true)
}
actions
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public enum AssetResource {
public static let radioButtonLightDisabled = ImageAsset(name: "radioButton-light-disabled")
public static let radioButtonLightSelected = ImageAsset(name: "radioButton-light-selected")
public static let radioButtonLightUnselected = ImageAsset(name: "radioButton-light-unselected")
public static let share = ImageAsset(name: "share")
public static let signingKey = ImageAsset(name: "signing-key")
public static let trash = ImageAsset(name: "trash")
public static let walletAppIcon = ImageAsset(name: "wallet-app-icon")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "share.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.

0 comments on commit 3e66941

Please sign in to comment.