From 822a30cd93eb80255b934da5d374c41722503c01 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Fri, 8 Mar 2024 19:45:33 +0530 Subject: [PATCH] feat(apple): In resources list, tapping on a list item shows a 'Copy Address' menu (#4050) Previousy, tapping on a resource list item in iOS copied the resource address. In this PR, tapping on a resource list item in iOS shows a menu with "Copy Address", tapping on which copies the resource address. Fixes #3998. --- .../FirezoneKit/Features/MainView.swift | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/swift/apple/FirezoneKit/Sources/FirezoneKit/Features/MainView.swift b/swift/apple/FirezoneKit/Sources/FirezoneKit/Features/MainView.swift index c118df862..38d9720cb 100644 --- a/swift/apple/FirezoneKit/Sources/FirezoneKit/Features/MainView.swift +++ b/swift/apple/FirezoneKit/Sources/FirezoneKit/Features/MainView.swift @@ -124,21 +124,21 @@ import SwiftUI Text("No resources") } else { ForEach(self.model.orderedResources) { resource in - HStack { - Text(resource.name) - Spacer() - Text(resource.location) - .foregroundColor(.secondary) - Button( - role: .none, - action: { self.copyResourceTapped(resource) }, - label: { - Label("", systemImage: "doc.on.doc") - .symbolRenderingMode(.monochrome) - .foregroundColor(.secondary) - } - ) - } + Menu(content: { + Button { + self.copyResourceTapped(resource) + } label: { + Label("Copy Address", systemImage: "doc.on.doc") + } + }, label : { + HStack { + Text(resource.name) + .foregroundColor(.primary) + Spacer() + Text(resource.location) + .foregroundColor(.secondary) + } + }) } } }