diff --git a/app-ios/Sources/ContributorFeature/ContributorView.swift b/app-ios/Sources/ContributorFeature/ContributorView.swift index 97544a93e..2aaff0045 100644 --- a/app-ios/Sources/ContributorFeature/ContributorView.swift +++ b/app-ios/Sources/ContributorFeature/ContributorView.swift @@ -51,7 +51,12 @@ public struct ContributorView: View { KmpPresenterContributorView() case .fullKmp: - KmpContributorComposeViewControllerWrapper() + KmpContributorComposeViewControllerWrapper { urlString in + guard let url = URL(string: urlString) else { + return + } + store.send(.view(.contributorButtonTapped(url))) + } } } .background(AssetColors.Surface.surface.swiftUIColor) diff --git a/app-ios/Sources/KMPClient/Views/KmpContributorComposeViewControllerWrapper.swift b/app-ios/Sources/KMPClient/Views/KmpContributorComposeViewControllerWrapper.swift index 92e05dca8..4ba35c072 100644 --- a/app-ios/Sources/KMPClient/Views/KmpContributorComposeViewControllerWrapper.swift +++ b/app-ios/Sources/KMPClient/Views/KmpContributorComposeViewControllerWrapper.swift @@ -2,16 +2,20 @@ import SwiftUI @preconcurrency import shared public struct KmpContributorComposeViewControllerWrapper: UIViewControllerRepresentable { + public typealias URLString = String + public let repositories: any Repositories + private let onContributorsItemClick: (URLString) -> Void - public init() { + public init(onContributorsItemClick: @escaping (URLString) -> Void) { self.repositories = Container.shared.get(type: (any Repositories).self) + self.onContributorsItemClick = onContributorsItemClick } public func makeUIViewController(context: Context) -> UIViewController { return contributorsViewController( repositories: repositories, - onContributorsItemClick: {_ in} + onContributorsItemClick: onContributorsItemClick ) }