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

[ABW-3649] Improve the address details actions to support increased font size #1238

Merged
merged 4 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -94,22 +94,35 @@ 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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we should decrease this spacing as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, not sure how much. Reducing this space will deviate from the design.

actionButton(L10n.AddressDetails.copy, image: .copyMedium) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are already resizing the image, why not use copy-big (that is 24x24`) and avoid adding a new asset?

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)
.opacity(0.6)
Text(title)
}
}
}

private var bottom: some SwiftUI.View {
VStack(spacing: .medium3) {
Button(L10n.AddressDetails.viewOnDashboard) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public enum AssetResource {
public static let close = ImageAsset(name: "close")
public static let code = ImageAsset(name: "code")
public static let copyBig = ImageAsset(name: "copy-big")
public static let copyMedium = ImageAsset(name: "copy-medium")
public static let copy = ImageAsset(name: "copy")
public static let create = ImageAsset(name: "create")
public static let ellipsis = ImageAsset(name: "ellipsis")
Expand All @@ -89,6 +90,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
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "copy-medium.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
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.
Loading