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

Added logic to open sheet when tapping contributor button in ContributorView #531

Merged
merged 1 commit into from
Aug 21, 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
7 changes: 6 additions & 1 deletion app-ios/Sources/ContributorFeature/ContributorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}

Expand Down
Loading